Cpp Coding Standards/CLSDESIGN/NewDel
From Apache OpenOffice Wiki
< Cpp Coding Standards | CLSDESIGN
Revision as of 13:38, 22 May 2007 by Np (talk | contribs) (Cpp Coding Standards/Class Design/NewDel moved to Cpp Coding Standards/CLSDESIGN/NewDel)
Failing to provide both of Class::operator new and Class::operator delete can subtly leak memory (because compiler-generated code, such as automatic resource deallocation during exception handling, needs it and might otherwise be silently left blank, if that operator is undefined).
Failing to provide all three forms of class-specific new/delete operators will hide the compiler provided default ones from your users. You should have good reasons to deprive them from that freedom.