I always thought…
- overriding means reimplementing a function (same signature) in a base class whereas
- overloading means implementing a function with same name but different signature
… and got confused because sometimes people just don’t care about the difference.
Concerning new/delete: Are they overloaded or overridden?
An idea:
- implementing new/delete operator in a Class = overload
- reimplementing global new/delete = override
Any corrections/suggestions/objections?
And feel free to tag the question “hairsplitting”…
For the global
operator newandoperator delete, it’s actually neither overloading nor overriding. A program is permitted to replace the default, implementation-provided definitions with its own definitions. The C++ standard says (§3.7.3/2):For a class-specific
operator neworoperator delete, the operators are overloaded.