I am working on a small library, where I have following requirements for any class X
:
class X
must be allocatable only usingoperator new
- All the children of
class X
should implicitly become allocatable only byoperator new
- The syntax for heap allocation should be elegant
- Not much of the existing code should be changed to incorporate this
- After some point of time, if I want to allow
class X
to be allocatable as automatic; again not much code should be changed
I also welcome C++0x solutions (for future use only).
[Note: I have done my part of research and will be posting it as an answer (tested for basic scenarios)]