Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2001-09-18 08:17:32


>----- Original Message -----
>From: Daniel Frey <daniel.frey_at_[hidden]>
>To: <boost_at_[hidden]>
>Sent: Tuesday, September 18, 2001 4:50 AM
>Subject: Re: [boost] noncopyable as a virtual base class?
>

>David Abrahams wrote:
>>
> > class A : noncopyable {};
> > class B : public A, noncopyable {};
>>
>> Then you can try to disable the warnings... ;-)
>
>How about:
>
>#define BOOST_NONCOPYABLE virtual ::boost::noncopyable
>
>to be used as
>
>class A : BOOST_NONCOPYABLE {};
>class B : public A, BOOST_NONCOPYABLE {};
>
>does anyone see any problem? Is this a bad approach?
>
Yes. It adds a *virtual* base class, not just a base class. The overhead of
a 'virtual' base might be unnecesary.

Besides, I agree with Dietmar: it is not necessary to derive from
noncopyable mutiple times, and I think that using multiple derivation *just*
to document something is a bad usage of the language; to a begginer, it
could appear as if multiple derivation were actually needed.


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