J
Juha Nieminen
James said:You lied to the compiler (and to the reader of your code).
First, you said that the object wasn't copiable, then you said
it was. I may be of the old school, but I find lying
despicable.
The simple solution to this problem is to fire the person who
wrote the code.
I'm not sure it's that simple. It can also be a genuine mistake.
In a long inheritance chain one of the classes buried somewhere in
there might have been made "noncopyable" for some purpose. Then someone
else might inherit from a class inherited from a class inherited... and
so on from that class, and *inadvertedly* write a copy constructor for
it, overriding the one in that "noncopyable" class.
Of course for this to compile this person has to, if I understood
correctly, fail to call the parent class copy constructor in his own. Of
course this is a bad mistake in itself, but it might happen.
The problem is that now, by pure accident, the class has become
copyable even though it should not be, and the compiler is of no help in
catching this.