Mail Archives: djgpp/1992/07/17/12:08:41
The Ansi C++ syntax admits the overloading of operator new in
the following way :
class X {
...
void *operator new(size_t s) { return (void *)malloc(s); } ;
void *operator new(size_t, int);
...
}
and then you can use
x = new(3) X; /* for example */
But this construct is not recognized by gcc/g++ . Does anybody
knows a (more or less) clean way to do the same job ?
I post this message in this mailing list as I have no access to the
Internet News at this time.
Thanks,
F. Popineau
--
----------------------------------------------|-------------------------------|
|e-mail: popineau AT loria DOT crin DOT fr | "God is real ... |
| popineau AT ese-metz DOT fr | ... unless integer ?" |
|voice-mail: (+33) 87-74-99-38 | |
|surface-mail: Ecole Superieure d'Electricite| |
| 2 rue Edouard Belin | "If you haven't been caught |
| 57078 Metz Cedex 3 | did you really do it ? " |
----------------------------------------------|-------------------------------|
- Raw text -