Difference between revisions of "Cpp Coding Standards/CLSDESIGN/NewDel"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
(No difference)

Revision as of 13:38, 22 May 2007

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.

Personal tools