Export (0) Print
Expand All
div
Expand Minimize
This topic has not yet been rated - Rate this topic

operator delete

Frees allocated block.

void __cdecl operator delete(
   void * object
);
void __cdecl operator delete(
   void * object, 
   void * memory
) throw();
void __cdecl operator delete(
   void * object, 
   const std::nothrow_t&
) throw();

Parameters

memory
The memory location being freed.
object
A pointer to the object being deleted.

Remarks

This form of operator delete is known as scalar delete, in contrast to the vector delete form (operator delete[]).

operator delete frees memory allocated by operator new.

The first form of this operator is known as the nonplacement form. The second and third forms of this operator will commonly not be called from code but exist to give the compiler a matching delete to call when a placement new fails.

The first form of the operator is defined by the compiler and does not require new.h to be included in your program.

With the exception of throwing or no-throwing behavior, the CRT operator delete behaves like operator delete in the Standard C++ Library.

Requirements

Routine Required header Compatibility
delete <new.h> Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.

Libraries

All versions of the C run-time libraries.

Example

See operator new for examples of using operator delete.

See Also

Memory allocation | Run-Time Routines and .NET Framework Equivalents

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.