In C++11, non-member void operator delete(void*, size_t)
is "placement deallocation with additional arguments". It corresponds to the placement allocation with additional arguments (if you defined one): void *operator new(size_t, size_t)
.
Clarification of this, according to 3.7.4.2, T::operator delete(void*, size_t)
is a usual deallocation function, but N3337 does not say that ::operator delete(void *, size_t)
is a usual deallocation function; in fact that signature for ::operator delete
does not appear anywhere in the document. Specifically, 17.6.4.6 does not list it amongst the global versions.
In C++1y, ::operator delete(void*, size_t)
is a usual deallocation function (i.e. non-placement). It seems to me at this is a breaking change between C++11 and C++1y.
According to N3797, in C++1y if you replace operator delete(void *)
then you must also replace operator delete(void *, size_t)
and vice versa. (Otherwise, presumably, the program is ill-formed).
Also according to N3797, either of those two functions may be called for deallocation, but I don't see a clear specification of in which circumstances which function is called.
Note: overloading is the wrong term; when you define a usual allocation operator, it replaces the standard library version.