Nick's answer is a good starting point, but incomplete, as you actually need to overload:
void* operator new(size_t); //standard new
void* operator new(size_t, void*); //placement new
void* operator new(size_t); //array new
void* operator new(size_t, void*);//placement array new
(Bună practica de codificare ar sugera că ar trebui să supraîncărcați operatorii de ștergere și ștergere  - aș vrea, dar din moment ce nu vor fi chemați, nu este necesar într-adevăr ).
Pauldoo is also correct that this doesn't survive aggregating on Foo, although it does survive inheriting from Foo. You could do some template meta-programming magic to HELP prevent this, but it would not be immune to "evil users" and thus is probably not worth the complication. Documentation of how it should be used, and code review to ensure it is used properly, are the only ~100% way.