Where is the correct place to initialize a class data member? I have the class declaration in a header file like this:
Foo.h:
class Foo { private: in
It can be initialized directly in the header file, in c++11 or gnu++11:
int myInt = 1;
See this article "C++11 Tidbits: Non-static Data Member Initializers"