From: Andreas Huber (ahd6974-spamboostorgtrap_at_[hidden])
Date: 2007-08-10 12:23:18


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.

Regards,

-- 
Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header.