I have a strange error.
class INST
{
public:
boost::mutex m_mutex;
};
std::vector<INST> m_inst;
error C2248: ‘boost::mutex::mutex’ : cannot access private member declared in class ‘boost::mutex’
see declaration of ‘boost::mutex::mutex’
However, my other class is fine,
class VIEW
{
public:
boost::mutex m_mutex;
};
VIEW m_view;
Am I missing something here? I have tried to declare m_mutex to private, but still have the same problem.
Thanks.
mutexes can’t be copied, so you can’t place them in a container which would copy the mutex. The error is likely referring to the private copy constructor of the mutex.