February 2005
Beginner to intermediate
272 pages
4h 53m
English
If you don’t like the way standard operator new and operator delete are treating one of your class types, you don’t have to stand for it. Instead, your types can have their own operator new and operator delete customized to their needs.
Note that we can’t do anything with the new operator or the delete operator, since their behavior is fixed, but we can change which operator new and operator delete they invoke (see Placement New [35, 119]). The best way to do this is to declare member operator new and operator delete functions:

When we allocate an object of type Handle in a new expression, the compiler ...
Read now
Unlock full access