mercredi 19 juillet 2017

The explicit keyword and constructors with more than one parameter for C++11

In general, I've heard it's good practice to use the explicit keyword on constructors with a single argument. However, as of C++11, constructors with more than one argument can be used for implicit conversions. As such, is it good practice to apply the explicit keyword to ALL constructors of > 0 arguments?

Aucun commentaire:

Enregistrer un commentaire