Is it possible to refer to class members inside "in class initializers"?
Example:
struct Example
{
std::string a = "Hello";
std::string b = a "World";
};
It seems to work (compiles and runs) but is it ok to do?
CodePudding user response:
Is it possible to refer to class members inside "in class initializers"?
Example:
struct Example
{
std::string a = "Hello";
std::string b = a "World";
};
It seems to work (compiles and runs) but is it ok to do?
CodePudding user response: