Compiler Error C2558
For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.
'identifier' : no copy constructor available or copy constructor is declared 'explicit'
A copy constructor initializes an object from another object of the same type. (It makes a copy of the object.) The compiler generates a default copy constructor if you do not define any constructors.
The problem can occur when an attempt is made to copy a class whose copy constructor is
private. In most cases, a class that has a
privatecopy constructor should not be copied. A common programming technique declares a
privatecopy constructor to prevent the direct use of a class. The class may be useless by itself or require another class in order to work correctly.
If you determine that it is safe to use a class that has a
privatecopy constructor, derive a new class from the class that has the
privateconstructor and make a
protectedcopy constructor available in the new class. Use the derived class in place of the original.
The problem can occur when an attempt is made to copy a class whose copy constructor is explicit. Declaring a copy constructor as
explicitprevents passing/returning objects of a class to/from functions. For more information about explicit constructors, see User-Defined Type Conversions.
The problem can occur when an attempt is made to copy a class instance declared
constby using a copy constructor that does not take a
constreference parameter. Declare your copy constructor with a
consttype reference instead of a non-const type reference.