I would like to lock the keys/index in another map like this:
std::map<int, boost::mutex> pointCloudsMutexes_;
pointCloudsMutexes_[index].lock();
However, I am getting the following error:
/usr/include/c++/4.8/bits/stl_pair.h:113: error: no matching function for call to 'boost::mutex::mutex(const boost::mutex&)'
: first(__a), second(__b) { }
^
It seems to work with std::vector
, but not with std::map
. What am I doing wrong?