> declare it as private and just leave an empty implementation?
ideally, declare it as private and do not define it.
> Is this common/useful?
useful, yes. common, not all that much.
if there is a class that you write (for example a window), and want its instances not to have value semantics, you need to suppress any compiler-generated copy constructor and assignment operators.
struct window
{
// ...
private:
window( const window& ) ; // do not define this
void operator= ( const window& ) ; // do not define this
// ...
}
see:
http://www.boost.org/doc/libs/1_37_0...ss_noncopyable
Reputation Points: 1159
Solved Threads: 285
Posting Virtuoso
Offline 1,606 posts
since Dec 2006