|
Boost : |
From: dietmar_kuehl_at_[hidden]
Date: 2001-09-18 05:26:39
Hi,
--- In boost_at_y..., Daniel Frey <daniel.frey_at_a...> wrote:
> 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
[snip]
Why would anybody want to do something like this? If a class is
noncopyable, eg. because it derives from 'boost::noncopyable',
all derived classes are automatically noncopyable unless, of course,
someone explicitly implements a copy constructor: For the implicit
copy ctor a copy ctor of all bases and members is necessary! Thus,
the solution to the "problem" is to remove the 'noncopyable' from
the list of bases of 'B'!
-- <mailto:dietmar_kuehl_at_[hidden]> <http://www.dietmar-kuehl.de/> Phaidros eaSE - Easy Software Engineering: <http://www.phaidros.com/>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk