|
-
June 27th, 2005, 05:01 PM
#25
Re: extending an STL container class Question
 Originally Posted by wien
The public inheritance in that case is an implemetation detail, and shouldn't even be known by the user.
No, public inheritance always means "IS-A", and it is known by the user, because the user can use the derived object like a base object. That means that the user can use all the member functions of the vector.
private inheritance can be an implementation detail, but public inheritance, is never an implementation detail.
And, private inheritance itself is very useful in some cases, but can generally (not always) be replaced by composition (i mean, putting a field in the class's declaration).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|