Details
-
Bug
-
Resolution: Done
-
Minor - P4
-
None
-
2.4.0-rc2
-
None
-
Linux / g++
-
Linux
-
Description
I get this warning when compiling against MongoDB C++ client library:
...mongo/util/goodies.h:136: warning: base class ‘class boost::noncopyable_::noncopyable’ should be explicitly initialized in the copy constructor
src/mongo/util/goodies.h has the following code:
class ThreadSafeString : boost::noncopyable {
public:
ThreadSafeString( size_t size=256 )
: _size( size ) , _buf( new char[size] )
ThreadSafeString( const ThreadSafeString& other )
: _size( other._size ) , _buf( new char[_size] )
What is the point first deriving from private boost::noncopyable and then defining a copy constructor with a body? It defeats the purpose. Either it could just define a private copy constructor, or define none at all and privately derive from boost::noncopyable.
Either way it would avoid this warning.