On Thu, Mar 13, 2003 at 11:15:21AM +0000, Tom Payne wrote:
> > I suspect what you want is something like the "pimpl" idiom as
> > outlined in Sutter's "Exceptional C++". It's not the nicest name but
> > it works out quite nice (pimpl stands for "private implementation").
> 
> Thanks Stefanus. This is much cleaner than the friend classes that I
> suggested. Downsides are you end up writing lots of wrapper functions in Foo
> to call the actual methods in FooImpl, and it adds another 

Actually, no. Having the data in a separate structure from the actual class
would even reduce the amount of code that would need to be converted. Most
of the time I use a standard name for the object that functions primarily
apply to. So one would just have to give the pointer in the container class
this name and only function definitions and calls should need to be modified.
Inheritance could cause some extra problems.

Other than that, I don't like the idea all that much. Makes things too
complicated. There's no "friend namespace", is there?-) Does g++ still 
not support namespaces?

-- 
Tuomo

Reply via email to