I have a quick question in gcc 4.8 with the flag -std=c++11 enabled. I can do this and it works fine.
class Test;
class StupidClass {
public:
StupidClass(Test *test) {}
};
class Test {
StupidClass c = StupidClass(/*this is the part in question*/ this);
};
and i wanted to know if this is valid c++11 having "this" in an in-class member initialization like this.
If you write
that is no different from:
So if the second one makes sense, so does the first.