Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-07-08 07:00:22


From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
> Peter Dimov wrote:
> > I disagree with the 'noncopyable' guideline. Here's why:
> >
> > * Deriving from noncopyable invokes warnings/remarks from
> > MSVC and Intel C++.
>
> So does the following definition:
>
> struct something
> {
> something(int i) : i_(i) {}
> int& i_;
> };

I know. I declare a private assignment operator.

> A better way to suppress them is to write "#pragma warning(disable: 4511
> 4512)" :). Personally, I think that the above warning is useless. You'll
> find out that "assignment operator could not be generated" as soon as you
> try to use one. Warning about it at the point of class definition is like
> shouting "you can't walk into this door!" to every person who just
happened
> to walk down the corridor ;).

I (almost) never impose my opinion of whether a warning is useful or not on
users, when I can avoid it.

--
Peter Dimov
Multi Media Ltd.

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