แปล ให้หน่อยจ้าาาา อีกอัน
Deallocate storage space
The first and second versions deallocate the memory block pointed by ptr (if not-null), releasing the storage space previously allocated to it by a call to operator new and making that pointer location invalid.
The third version does nothing.
The second and third versions cannot be implicitly called by the operator expression (the delete operator calls once the function operator delete for each of its arguments). Although they can be called explicitly as operator new function calls, their default definitions serve no particular purpose - they are provided as counterparts for the operator new functions and called accordingly when done automatically.
Global dynamic storage operator functions are special in the standard library:
All three versions of operator delete are declared in the global namespace, not in the std namespace.
The first and second versions are implicitly declared in every translation unit of a C++ program: The header <new> does not need to be included for them to be present.
The first and second versions are also replaceable: A program may provide its own definition, that replaces the default one, to produce the result described above.
operator delete can be called explicitly as a regular function, but in C++, delete is an operator with a very specific behavior: An expression with the delete operator, first calls the appropriate destructor (if needed), and then calls function operator delete to release the storage.