handle constructor failure

when the constructor throws exception how is the memory allocated to the object is reverted back.for example
class x
{
public:
x()
{}
~x()
{}
};
int main()
{
try{
x *a=new x();
}
catch(...)
{}
}
Now if the constructor throws exception ,the memory allocated on heap how would it be reverted as the destructor of partially initialised object can not be called ??
Topic archived. No new replies allowed.