How do I invoke the nothrow version of delete?

Viewed 6486

I have the following code, which doesn't compile:

int *p = new(nothrow) int;
delete (nothrow) p; //Error

The error I get is:

error C2440: 'delete' : cannot convert from 'const std::nothrow_t' to 'void*'

Does a nothrow version of delete exist? If so, how can I invoke it?


In C++: The Complete Reference, it's given that it exists but I saw different opinions online, hence the confusion.

MSDN also talks about its existence, but I couldn't find how it can be used in code.

Here, some people are saying that there is no such thing.

3 Answers
Related