This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]