Does gcc support "delete (nothrow)"? I ran into 2 problems:

1. I had to call destructor directly since

A *p = new  (std::nothrow) A;
delete (std::nothrow) p;

won't cpmpile. I had to use

A *p = new  (std::nothrow) A;
...
operator delete (bb, std::nothrow);

2.

A *bb = new (std::nothrow) A [10];
...
operator delete [] (bb, std::nothrow);

causes memory corruption since compiler doesn't support

delete (std::nothrow) [] p;

What is the proper way to use "delete (nothrow)"?


H.J.

Reply via email to