OK, now I see what you are trying to do. I am afraid your idea is not realizable in C++. Overloads of new cannot have access to the object being constructed because construction takes place later. The sequence of operations performed by the compiler is
Call the operator new (the default or a user-defined version) passing the size of the object to be constructed.
new allocates the memory as it sees fit and returns a void *.
The compiler uses this pointer to lay out the object, calling then its constructor.
So, by the time your overloaded new is called, the object does not even exist. I don't think you can workaround this. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo