This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Is delete (nothrow) supported?
- From: "H. J. Lu" <hjl at lucon dot org>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 9 Jan 2007 13:55:44 -0800
- Subject: Is delete (nothrow) supported?
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.