My question is what does a constructor return? This question is not quite different from \"What is the return type of a constructor?\" I have read somewhere that a construct
what about this:
int main() {
const empty &er = empty();
empty *ep = const_cast(er); //casting away conentness to make changes in the members
cout<<"\n main ends \n";
//dtor get called here
}
ctor returns a const reference to a memory location(*this), you can cast away the const and use its as a nonconst normal object like empty *e = new e;