Is it good practice when writing C++11 code to set default values for class members in the header file of the class?
Or is it better to do this in the constructor of
Initializing in headers has the main advantages of keeping code more local and easy to understand. It saves also some typing.
The main disadvantage, in my opinion, is the need to include more headers to get access to constructors. Simple forward declaration won't suffice, making compilation take longer.