In C++11, can do this to initialize an object without using initialization list:
class Z{
int a=0;
int b;
z():b(0){} //<-- a already initialized
};
What I'm wondering is for class types, which of these is preferable:
class Z{
std::vector<int>a=std::vector<int>();
//or instead:
std::vector<int>a();
int b;
z():b(0){} //<-- a already initialized
};