当一个类在构造过程中抛出异常时,分配的内存会发生什么情况?你应该如何处理这样的情况。例如:
std::auto_ptr<ThirdPartyClass> au_tpc;
try
{
au_tpc.reset(new ThirdPartyClass());
}
catch(...)
{
// What happened to the memory allocated of
// sizeof(ThirdPartyClass) for the new instance?
}