Destructs object(s) previously allocated by the new expression and releases obtained memory area
Destructs objects, previously constructed by
new expression and releases the obtained memory area. The Template:sparam must result in a pointer value that was returned by previous call to the
new expression. For single allocated objects the first version of the expression must be used, whereas for arrays the second version must be used. There is no delete expression deallocating objects initialized by placement new, deallocation function and destructor must be explicitly called.
The deallocation function's name is firstly looked up in the local class type scope and only if the lookup fails, the global namespace is looked up. If
:: is present in the
delete expression, only the global namespace is looked up. The prototype of the function must look like the following:
Template:ddcl list begin <tr class="t-dcl "><td >
<td class="t-dcl-nopad"> </td> <td > for the first version </td> </tr> <tr class="t-dcl "><td >
<td class="t-dcl-nopad"> </td> <td > for the second version </td> </tr> Template:ddcl list end
Both these functions are implicitly declared in each translation unit. Also, implicit implementations are provided by the compiler by default, unless the program has explicitly implemented them. See this for more information.