X
Xie Yubo
Hello every,
I have a question, could you help me?
How do I enforce the user create a object via operator new only?
For example, there is a class C:
class C
{
.....
}
Then the user can only create a C object with:
C* p = new C;
and
C c;
is forbided.
Are there some ways to implement it?
Thanks!
I have a question, could you help me?
How do I enforce the user create a object via operator new only?
For example, there is a class C:
class C
{
.....
}
Then the user can only create a C object with:
C* p = new C;
and
C c;
is forbided.
Are there some ways to implement it?
Thanks!