This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: inline operator delete redefinition and in-charge deletingdestructor


Hi Christian.

You need...
#include "new"
... at the top of your i.h file.

Also, destructors have () parameter specification, not (void) for their parameters.

Also, your header files should have guards to make sure they are only included once.

Also, C++ uses...
#include <cstdio>
... not...
#include <stdio.h>

Also, you may want to change the name of your "new" header file to "mynew.h" or "mynew.hxx" or "mynew.hpp". I prefer the first convention.

Style point: MyClass* b = new MyClass; (the C++ way) is preferable to MyClass *b = new MyClass; (the C way).

Style point: you should put the "extern int glob;" in a header file, instead of hard coded.

HTH,
--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]