C++ pimpl

so so at so.so
Mon Jan 23 09:09:29 PST 2012


On Mon, 23 Jan 2012 18:09:58 +0200, Robert Caravani <jfanatiker at gmx.at>  
wrote:

> Thanks for the links, it was a good read.

I think it is the best answer to the problem.

> What's the destructor limitation?

struct S {
   static S* make(); // constructor
   static void purge(S*); // destructor - you have to provide this as well
}

Limitation is that just like constructor, we also lose the destructor.
Which means we can't use "delete", and the tools designed for it.
As a result we don't have something new. It is exactly like C impl. hiding.

struct S;
S* make();
void purge(S*);


More information about the Digitalmars-d mailing list