how can i implement operator new or delete?
Posted: Thu Dec 04, 2003 8:54 am
i know i should write it like this:
void *operator new(size_t size)
{
return malloc(size);
}
but there is a question.
as we know, the operator new() would call constructor of the object.
in the code, i don't call the constructor,
so, i want to know,how can i do it ?
the same as delete() which should call deconstructor.
i need your help!
thank you very much!
void *operator new(size_t size)
{
return malloc(size);
}
but there is a question.
as we know, the operator new() would call constructor of the object.
in the code, i don't call the constructor,
so, i want to know,how can i do it ?
the same as delete() which should call deconstructor.
i need your help!
thank you very much!