Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-07-08 11:43:24


So use prefix and suffix headers.
Surely there are more special-case things one needs to do for MSVC ;-) ?

-Dave

----- Original Message -----
From: "Peter Dimov" <pdimov_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Sunday, July 08, 2001 9:59 AM
Subject: Re: [boost] Coding guidelines - noncopyable

> From: "David Abrahams" <david.abrahams_at_[hidden]>
> > > I (almost) never impose my opinion of whether a warning is useful or
not
> > on
> > > users, when I can avoid it.
> >
> > If you are intent on that, there is always
> >
> > #pragma warning(push)
> > #pragma warning(disable: 4511 4512)
> > ...
> > #pragma warning(pop)
>
> OK, let's compare the alternatives:
>
> [1]
>
> class X // noncopyable
> {
> public:
>
> // ...
>
> private:
>
> // ...
>
> X(X const &);
> X & operator= (X const &);
> };
>
> [2]
>
> #include <boost/noncopyable.hpp>
>
> #ifdef _MSC_VER
> #pragma warning(push)
> #pragma warning(disable: 4511) // copy constructor not generated
> #pragma warning(disable: 4512) // assignment not generated
> #endif
>
> class X: private noncopyable
> {
> public:
>
> // ...
>
> private:
>
> // ...
>
> }
>
> #ifdef _MSC_VER
> #pragma warning(pop)
> #endif
>
> --
> Peter Dimov
> Multi Media Ltd.
>
>
> Info: http://www.boost.org Unsubscribe:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


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