Boost logo

Boost :

From: ivec_at_[hidden]
Date: 2001-07-08 03:10:47


--- In boost_at_y..., "Peter Dimov" <pdimov_at_m...> wrote:
> I disagree with the 'noncopyable' guideline. Here's why:

I would also prefer this guideline to be removed, as well as the
recommendation mentioned by Aleksey
(at http://www.boost.org/more/library_reuse.htm).

I have stopped using noncopyable mostly because it creates an
inheritance relationship between unrelated classes that rely on it.
The inconvenience is especially severe when using a reverse-
engineering tool (e.g. free www.doxygen.org) which generates
graphical class hierarchies.

I currently prefer adding the individual copy-ctr & op=. No big deal.
If anything, I would rather use a preprocessor macro (e.g. add a
BOOST_DEFINE_NON_COPYABLE).

Saving two lines of code is not worth messing up a class hierarchy
(in addition to the problems mentioned by the OP).

Ivan Vecerina (a new poster here)

> * Deriving from noncopyable invokes warnings/remarks from MSVC and
Intel
> C++. In order to suppress them, I have to declare the copy
constructor and
> the assignment operator private, which defeats the purpose.
>
> * In order to derive from boost::noncopyable, I have to introduce a
> dependency on boost/utility.hpp. Since headers with such names tend
to
> change frequently, this means frequent recompilations for no
apparent
> reason.


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