In C++ :
You can not do this, As it will be recursive structure (no end for calculating object size) , to Overcome this problem,
Use Self Referential Pointer i.e. the Pointer having the address of Same class type.
class A
{
A* aObj; // Self Referential Pointer
}