Reputation: 2136
On the site of cppreference, I see the following sentence:
This is a list of reserved keywords in C++. Since they are used by the language, these keywords are not available for re-definition or overloading.
Among the keywords, there is new. But I know that we can overload new in C++. So the above citation is wrong or there is something else there for the keyword new ?
Upvotes: 1
Views: 114
Reputation: 76523
You can't overload new
. You can overload operator new
, which is the function that new
calls to allocate memory before it constructs the object(s).
Upvotes: 15