Re: deriving a class from STL class list???
From: Alwyn (dt015a1979_at_mac.com.invalid)
Date: 11/24/04
- Next message: Rui Maciel: "Re: Learning C++"
- Previous message: Ulrich Eckhardt: "Re: deriving a class from STL class list???"
- In reply to: Barry Hynes: "deriving a class from STL class list???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 24 Nov 2004 18:06:57 +0000
In article <uo3pd.184595$Np3.7474822@ursa-nb00s0.nbnet.nb.ca>, Barry
Hynes <hynesb@mar.dfo-mpo.gc.ca> wrote:
>
> Implement a class safeList, that is derived from the STL class list and uses
> exception handling.
>
> I have done a little bit of reading and it says that it is not wise to
> derive from STL classes because there are no virtual destructors...
>
> is there a specific way to do this?
Try something like:
template <class T>
class MyList : private std::list<T>
{
};
With private inheritance, you don't get the problem you mentioned.
Alwyn
- Next message: Rui Maciel: "Re: Learning C++"
- Previous message: Ulrich Eckhardt: "Re: deriving a class from STL class list???"
- In reply to: Barry Hynes: "deriving a class from STL class list???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]