This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
Compiler Error C2558
'identifier' : no copy constructor available
A copy constructor initializes an object from another object of the same type. (It makes a copy of the object.) compiler generates a default copy constructor if you do not define any constructors.
Possible cause
- Trying to copy a class whose copy constructor is with a private. In most cases, a class with a private copy constructor should not be copied. A common programming technique declares a private copy constructor to prevent the direct use of a class. The class may be useless by itself or require another class in order to work properly.
Possible solution
- If you determine that it is safe to use a class with a private copy constructor, derive a new class from the class with the a private constructor and make a public or protected copy constructor available in the new class. Use the derived class in place of the original.
See Also
Compiler Errors when Implementing a CObject-Derived Class.