Boost logo

Boost Users :

Subject: Re: [Boost-users] metafunction question
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2010-05-12 02:59:14


Le 11/05/2010 19:41, JOAQUIN M. LOPEZ MUÑOZ a écrit :
> ________________________________________
> De: boost-users-bounces_at_[hidden] [boost-users-bounces_at_[hidden]] En nombre de Mathias Gaunard [mathias.gaunard_at_[hidden]]
> Enviado el: martes, 11 de mayo de 2010 20:35
> Para: boost-users_at_[hidden]
> Asunto: Re: [Boost-users] metafunction question
>
>> Le 11/05/2010 19:30, John Dlugosz wrote:
>>
>>> Consider a class derived from an STL collection.
>>
>> You should never do that.
>
> Why not, why never? My opinions on this issue at:
>
> http://bannalia.blogspot.com/2008/02/derivation-without-virtual-destructor.html

While there are technical reasons not to do so (absence of virtual
destructor), there are also non technical ones.

It simply doesn't make sense to use inheritance for this. Inheritance is
for polymorphism, not code reuse.

This is why for example free functions that take any range are better
than member functions.


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