problem when using boost::noncopyable_::noncopyable

I defined a class inherited from noncoyable and singleton, but when compiled by vc8.0(VC++ express 2005), it report a error like this: template<typename T> class thread_pool : boost::noncopyable, public boost::singleton { //... }; center\code\project.net\include\thread_pool.hpp(227) : error C2248: 'boost::noncopyable_::noncopyable::operator =' : cannot access private member declared in class 'boost::noncopyable_::noncopyable' c:\boost\include\boost-1_33_1\boost\noncopyable.hpp(28) : see declaration of 'boost::noncopyable_::noncopyable::operator =' c:\boost\include\boost-1_33_1\boost\noncopyable.hpp(22) : see declaration of 'boost::noncopyable_::noncopyable' This diagnostic occurred in the compiler generated function 'core::thread_pool<worker> &core::thread_pool<worker>::operator =(robert::core::thread_pool<worker> &)' with [ worker=core::worker_thread ] I wonder why it need to generate function overriding operator '='. Is there any simple solution?

bwlee wrote:
I wonder why it need to generate function overriding operator '='.
Perhaps because you're trying to assign one thread pool to another somewhere? (Possibly template-generated code.) Declare the operator as private and don't implement it, perhaps you'll get a better diagnostic. Sebastian Redl
participants (2)
-
bwlee
-
Sebastian Redl