Boost logo

Boost :

From: Bo Persson (bop_at_[hidden])
Date: 2007-08-10 16:13:20


Andreas Huber wrote:
:: Hi John
::
:: John Maddock <john <at> johnmaddock.co.uk> writes:
:::: # pragma warning( disable: 4511 ) // copy constructor could not
:::: be generated # pragma warning( disable: 4512 ) // assignment op
:::: could not be generated
::::
:::: IMO, these warnings are not very useful. Users will get heaps of
:::: them when they employ the library, so disabling them permanently
:::: is a good thing.
:::
::: I agree that they're useless, but I believe they'll still get
::: suppressed for any instances of your templates that are
::: instantiated if there is a matching #pragma warning(pop).
::
:: Correct. However, typical Statechart client code looks as follows:
::
:: #include <boost/statechart/simple_state.hpp>
::
:: struct MyMachine ....;
:: struct MyState : sc::simple_state<MyState, MyMachine> { ... };
::
:: simple_state<> ultimately derives from noncopyable, which is why
:: the warnings are generated in the first place. Popping at the end
:: of the header would suppress the warnings for simple_state<> but
:: would produce warnings for MyState. Since I believe that *all*
:: users who care about warnings will disable these in their code
:: anyway, I think the most user-friendly approach is to permanently
:: disable them in the library header.
::

Even those who don't care, but use one of the MS frameworks, like MFC
or ATL, will get them disabled anyway. These warnings are disabled in
8-10 headers supplied with VC8. No pushing, no popping!

Bo Persson


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