user2100910
user2100910

Reputation: 327

Where's boost::get_reference() now?

Since boost::mutex is not "Default Constructible", I cannot get a reference of it directly. I googled this problem, and find get_reference() is probably the solution. But I find in my "boost/utility/" folder, there's no "get_reference.hpp".

Does anyone know whether get_reference() is still supported? Or any alternative solutions of this problem (get a reference of boost::mutex)?

Thanks, Cui

Upvotes: 0

Views: 44

Answers (1)

Igor R.
Igor R.

Reputation: 15075

boost::mutex is default-constructible. It is not copiable. Your question is unclear, but I guess you're trying to use mutex in a bind expression or to pass mutex to an algorithm that copies its arguments, and you're looking for boost::ref wrapper, aren't you?

#include <boost/ref.hpp>
//...
boost::ref(yourMutex)

Upvotes: 1

Related Questions