Class X -> converted to Y by two ways 1) constructors, and 2) by conversion functions.
I understood the single argument constructor is used for conversion.
In the specification:
An implicitly-declared copy constructor is not an explicit constructor; it may be called for implicit type conversion.
Question:
So, that means not only single argument constructor is used for the conversion, but also copy constructor?. If so, which scenario it is used?. any snippet of sample code?
Kindly bear with me if the question is very basis.
Implicitly-declared copy constructor cannot use for conversions, since it’s
copy-ctor, that has declared asT(const T&)orT(T&).draft n3337 par 12.8 C++ standard.
Since copy c-tor is not explicit you can use such code
If
copy-ctoris explicit you could use only initizaliation likeSo s((So()));