Tuesday, November 9, 2010

Explicit Constructors

The following constructor considered a one argument constructor: MyClass::MyClass(int a, int b = 0);

This constructor will still be used in an implicit conversion. It is best to use the "explicit" keyword, unless you really want implicit conversions.

No comments:

Post a Comment