Boost logo

Boost :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2004-12-19 14:02:53


----- Mensaje original -----
De: David Abrahams <dave_at_[hidden]>
Fecha: Domingo, Diciembre 19, 2004 2:58 pm
Asunto: [boost] Re: boost::noncopyable

> JOAQUIN LOPEZ MU?Z wrote:
>
> >> >> 2.) When should I derive public and when private from
> >> boost::noncopyable?>
> >> > Given what I said, I think that deriving from boost::noncpyable
> >> > must be avoided if multiple inheritance is present and you
> >> > expct your class to be allocated on the stack.
> >>
> >> "Must be avoided" is a bit strong. One extra byte usually
> makes no
> >> difference for a class that will be allocated on the stack.
> >
> > My fault: I meant "allocated on the heap".
>
> But the same argument applies. One extra byte usually makes no
> difference.

Well, yes, certainly. Possibly, the cases were it matters
are not that common. In my work at Boost, I use noncopyable
nodes to build data structures, and here deriving from
boost::noncopyable is a no-no. In many other situations,
as you say, it doesn't make any serious difference.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk