Hi, I have a class which defines a static callback: -------------------------------------------------------------- class CDeviceManager { private: struct TCallbackUserData { CDeviceManager* ptrThis; INT CurrentApi; }; // Since the callback is static, I need this struct to pass data TCallbackUserData CBUserData_; boost::mutex Mutex_; }; INT CDeviceManager::audio_callback(void *outputBuffer, void *inputBuffer, UINT nBufferFrames, double streamTime, RtAudioStreamStatus status, void *userData ) { CDeviceManager* This = 0; TCallbackUserData* UserData = (TCallbackUserData*)userData; This = UserData->ptrThis; // Used if the audio device is opened with simultaneous API boost::lock_guardboost::mutex lock(This->Mutex_); } -------------------------------------------------------------- But on compiling I get: 1>d:\lib\boost_1_42_0\boost\thread\win32\mutex.hpp(38) : error C2248: 'boost::noncopyable_::noncopyable::operator =' : cannot access private member declared in class 'boost::noncopyable_::noncopyable' 1> d:\lib\boost_1_42_0\boost\noncopyable.hpp(28) : see declaration of 'boost::noncopyable_::noncopyable::operator =' 1> d:\lib\boost_1_42_0\boost\noncopyable.hpp(22) : see declaration of 'boost::noncopyable_::noncopyable' 1> This diagnostic occurred in the compiler generated function 'boost::mutex &boost::mutex::operator =(const boost::mutex &)' I know that the mutex is noncopyable, but I use this many times. It depends by the 'static' method? Regards, Daniele.
participants (1)
-
Daniele Barzotti