Hi everyone,
Anyone know how to inhibit the compiler's autogeneration of copy constructors and equals operators for classes other than defining your own
I have a template queue class for which cloning is not really a valid operation, and as such some of it's nested types are not suitable for auto-generated copy constructors/operators.
Because of this, when I compile some code that uses the outer template class, I get compiler errors such as:
error C2678: binary '=' : no operator found which takes a left-hand operand of type 'volatile T<itemtype>::NestedType' (or there is no acceptable conversion)
When I double-click on the error, the editor simply goes to the end of the class declaration that has declared a member of type T<sometype>.
Further investigation down the error list yields:
This diagnostic occurred in the compiler generated function T<itemtype> &T<itemtype>::operator =(const T<itemtype> &)'.
I can fix the error by defining a dummy copy constructor that is a clone of my default constructor, but I feel that misleads programmers using the class into thinking they can clone an instance of that type.
Is there anything else I can do