What is conversion constructor?

conversion constructor
A constructor that accepts one argument of a different type.
The compiler uses this idiom as one way to infer conversion rules for a class. A constructor with more than one argument and with default argument values can be interpreted by the compiler as a conversion constructor when the compiler is looking for an object of the type and sees an object of the type of the constructor's first argument.

No comments:

 
Top Blogs