mardi 5 juin 2018

initializing member variables in definition

With C++11 it is possible to initialize member variables when defining them inside their class. Personally, I prefer initializing them solely in the initialization list of the constructor. What's the behaviour of initializing member variables in definition when having multiple constructors ? is that a good practice ? what do you think of mixing the two ways of initializations (in constructor's initialization list and in definition).

Aucun commentaire:

Enregistrer un commentaire