Hi,
I encounter a strange behavior of BCB 5.6. The example:
#include <stdexcept>
#include <memory>
using namespace std;
class A
{
public:
A() { cout << "A constructed.\n"; }
~A() { cout << "A destructed.\n"; }
};
void main()
{
try
{
auto_ptr<A> apA(new A);
throw logic_error("Too bad!");
}
catch (some_except& e)
{
cout << "Exception cought: " << e.what() << "\n";
}
}
The output:
A constructed.
Exception cought: Too bad!
i.e neither ~apA() nor ~A() are called. -xd option (desctuctor
cleanup enabled) does not work both in IDE and command prompt.
Does anybody knows how to force the standard behavior with
borland compiler?
--
Thanks in advance.