Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You're possibly thinking of the placement and nothrow forms of operator delete, which have the signatures:</p> <pre><code>void operator delete(void *, void *) throw(); void operator delete(void *, const std::nothrow_t&amp;) throw(); void operator delete[](void *, void *) throw(); void operator delete[](void *, const std::nothrow_t&amp;) throw(); </code></pre> <p>These are never called during normal operation, but would be used in the case where the constructor for an object being constructed with <a href="http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.10" rel="nofollow noreferrer">placement new</a> throws an exception. Generally you don't have to define them, since the compiler already called the destructor(s) on the dead object's bases and members, and for placement new there's no memory to be freed. But can exist if you are overloading placement new and need a corresponding operator.</p> <p>The second argument is not really used, and just distinguishes the signature for the ordinary:</p> <pre><code>void operator delete(void *) </code></pre> <p>These aren't special dummy arguments the way the operator++ ones are, though. They're just an instance of the general rule that call to new with extra arguments, such as:</p> <pre><code>obj = new(x,y,z) Object(a,b,c) </code></pre> <p>will generate implicit code to clean up from constructor errors that passes those same additional arguments to the operator delete, which will function (approximately) like:</p> <pre><code>void *raw = operator new(sizeof(Object), x,y,z) try { obj = new(raw) Object(a,b,c); } catch(...) { operator delete(raw,x,y,z); throw; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload