I know that maybe this is not the best design in the world, but i interested in the answer without any practical reason.
Let assume i have these two class with overloaded new methods:
class Base {
public:
operator void* new(size_t);
};
class Child : public Base {
public:
operator void* new(size_t); //THIS, i would like this to be the "original" new.
};
operator void* Base::new(size_t) {
//...
return new Child;
//...
}
I would like Child::new to work like the original new, so i could avoid using malloc.
Is there a way to do it?
Thanks ahead!