mirror of
https://github.com/boostorg/statechart.git
synced 2026-01-22 05:42:26 +00:00
Now avoids the "conditional expression is constant" warning in a more generic way.
[SVN r22552]
This commit is contained in:
@@ -167,6 +167,10 @@ namespace
|
||||
template<>
|
||||
void FillEventArray< 0 >() {}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
template< typename T >
|
||||
T AvoidConstantWarning( T value ) { return value; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
template< unsigned int msb, bool display >
|
||||
void VisitAllStates( BitMachine & bitMachine )
|
||||
@@ -175,20 +179,11 @@ namespace
|
||||
bitMachine.process_event( *pFlipBitEvents[ msb ] );
|
||||
++eventsSentTotal;
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable: 4127 ) // conditional expression is constant
|
||||
#endif
|
||||
|
||||
if ( display )
|
||||
if ( AvoidConstantWarning( display ) )
|
||||
{
|
||||
DisplayMachineState( bitMachine );
|
||||
}
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
||||
VisitAllStates< msb - 1, display >( bitMachine );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user