Boost logo

Boost :

From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-08-02 04:09:54


--- Edward Diener <eddielee_at_[hidden]> wrote:
> E. Gladyshev wrote:

> The pImpl technique is an idiom for hiding the
> private methods and data
> members of a class from the view of the user of that
> class.

By using a predefined ImplTraits you are actually
achiving the same pImpl hiding effect. The user can
just use a predefined ImplTraits class w/o any idea
about its methods.

> appeal for me. It makes the user of the class see
> only what is relevant in
> the class,

The reason of hiding something from the user is not
enough to throw away all the benefits of the
ImptTraits idiom. See my discussion with Douglas
Gregor about boost::thread library.
I strongly believe that it needs to be overwritten.

>while putting the implementation details
> of the class interface
> somewhere else. That it also speeds up compilation
> by not having the class,
> as the compiler sees it, change when the internal
> class as represented by
> its private pImpl pointer changes, is a side benefit
> to it but not one I
> consider overridingly important. I agree that it
> achieves little other than
> an aesthetic view of class internals and a speed up
> in build times when a
> class's implementation, as opposed to its end-user
> interface, changes. As
> such there is no pragmatic design reason why it is
> necessary. These are the
> major reasons, as I understand it, why the pImpl
> idiom is generally used and
> why I have used it. But there may be other reasons.

Again see my discussin with DG.

> I don't understand what this has to do with modern
> C++ as you see it. But I
> think that your view of modern C++, a term perhaps
> taken from Mr.
> Alexandrescu's fine book on template programming and
> metaprogramming
> techniques,

It is a very good example or modern C++.

> I only hope
> that you don't get into
> the habit of seeing all of modern C++ programming as
> template programming
> only, and view all other programming and design
> idioms from that
> perspective.

In my view, modern C++ is template programming plus
programming data types for these templates.

Eugene

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk