new, delete and nothrow

D

dasjotre

Alex said:
Can we use
operator delete (p, nothrow) ?

not like that, you must call it in a normal function call way

if Foo has a delete operator like this
void operator delete(void *, std::nothrow_t)

Foo * p = new (std::nothrow) Foo;
p->operator delete(p, std::nothrow);
 
D

dasjotre

dasjotre said:
not like that, you must call it in a normal function call way

if Foo has a delete operator like this
void operator delete(void *, std::nothrow_t)

Foo * p = new (std::nothrow) Foo;
p->operator delete(p, std::nothrow);

ups, sorry, I didn't wake up yet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top