Opt-out of copy constructor

Posted by sheepsimulator on Stack Overflow See other posts from Stack Overflow or by sheepsimulator
Published on 2010-04-27T19:50:06Z Indexed on 2010/04/27 19:53 UTC
Read the original article Hit count: 465

Filed under:
|
|

This might be a silly question, but...

I've been writing a number of classes that utilize non-copyable members. These classes are never initialized via the copy constructor in my source. When I try to compile without supplying my own copy-constructor, g++ throws out many errors about how it can't build a default copy constructor, due to the non-copyable member objects.

Is there a way to tell the compiler to just not give me a copy constructor?

© Stack Overflow or respective owner

Related posts about c++

Related posts about g++