From: Jeff Garland (jeff_at_[hidden])
Date: 2002-02-05 18:15:00


> From: "Andrei Alexandrescu" <andrewalex_at_[hidden]>
> Date: Tue, 5 Feb 2002 14:06:47 -0800
> > That's the wrong way of doing it. You don't inherit from a class just to add
> > data members and/or functions. (It's true it was a popular idiom in early
> > C++.)
>
> I'm just confused. If so, when can we use a public inheritance? Do
> you think what the defect in this implementation is?

I think Andrei's statement might have overstated a bit. Usually you want public
subclasses to be substitutable
(http://www.objectmentor.com/resources/articles/lsp.pdf). Seems like the
fixed_* classes fail on this point because they narrow the interface in an
unexpected fashion.

Jeff