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

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top