An expression operator new(sizeof(T))allocates Tbytes through ::operator new, right?
Is there a way to call the version class class operator new, if one exists, in the same way as new T()allocating memory (before calling the constructor)?
T::operator new(sizeof(T))gives a compile-time error if it Tdoes not define it operator new, even if it Tinherits the base class that defines it. I would like to name:
Foo::operator newif Foodeterminesoperator newBase::operator newif Foocomes from Basewhich defines operator new(what should I do with multiple inheritance?)::operator new otherwise
source
share