|
Boost Users : |
From: Daryle Walker (darylew_at_[hidden])
Date: 2004-09-05 18:00:43
On 9/2/04 12:40 PM, "Jonathan Turkanis" <technews_at_[hidden]> wrote:
[SNIP]
> Note that it is fairly common for a stream to derive privately from
> basic_streambuf; with the current implementation, testing such a stream using
> is_streambuf causes a compiler error.
I think that using private inheritance as an quick & dirty containment
strategy is a bad idea in general. (Which includes this usage.) All the
member names of the contained object's class get injected as member names of
the container object's class. Also, the container object's member functions
(and friends) still see the relationship as IS-A, even though it's supposed
to be HAS-A, so inappropriate conversions and/or uses won't be checked.
-- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net