Hi everybody:
I tried to implement this:
namespace Test
{
void* operator new(size_t s)
{
return malloc(s);
}
}
But g++ (4.3.1) says:
void* Test::operator new(size_t)’ may not be declared within a namespace
Am I doing something wrong?
If yes, is there anyway to overload the operator new to be used in my classes? I do not want to create a base class and make all my classes inherit from such base class.