How to design a class which can only be allocated from stack frame? Any ideas?
How to design a class which can only be allocated from stack frame? Any ideas?
Do you mean allocated on the stack ?
Code:class foo
{
protected:
foo( );
};
And how do you make an instance of class foo?
Meh, nevermind. That's a class that just can't be instantiated. I thought for a second that you would just make it friend to another class but that would give it the right to instantiate it on the heap. Sorry.
overload new to not allow dynamic allocation? Perhaps I'm getting my terms mixed up.