I'm curious about an idiom, or say technique for class to hold a member reference to the instance of itself like in below
class A
{
public:
A & instance;
public:
A():instance(*this){}
};
It works fine in VC11 with 0x enabled, though I'm not sure it works same for other compilers, for that this
might not have necessarily referred to the according "this-will-being" object at that moment during instantialization. Could someone specify the semantics of initialization list by demonstrating all assignments here? Is it standard or not?