From 2b67e5a18292fd1a2570ff9b5302a1173b160a54 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 26 May 2001 10:58:43 +0000 Subject: [PATCH] cast integral constant expression to bool to fix some compiler warnings and some compiler bugs. [SVN r10230] --- include/boost/static_assert.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/static_assert.hpp b/include/boost/static_assert.hpp index ec1995d..af42173 100644 --- a/include/boost/static_assert.hpp +++ b/include/boost/static_assert.hpp @@ -58,21 +58,21 @@ template struct static_assert_test{}; #ifndef BOOST_MSVC #define BOOST_STATIC_ASSERT( B ) \ typedef ::boost::static_assert_test<\ - sizeof(::boost::STATIC_ASSERTION_FAILURE< ( B ) >)>\ + sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\ BOOST_ASSERT_JOIN(boost_static_assert_typedef_, __LINE__) #else // __LINE__ macro broken when -ZI is used see Q199057 // fortunately MSVC ignores duplicate typedef's. #define BOOST_STATIC_ASSERT( B ) \ typedef ::boost::static_assert_test<\ - sizeof(::boost::STATIC_ASSERTION_FAILURE< ( B ) >)\ + sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)\ > boost_static_assert_typedef_ #endif #else // alternative enum based implementation: #define BOOST_STATIC_ASSERT( B ) \ enum { BOOST_ASSERT_JOIN(boost_static_assert_enum_, __LINE__) \ - = sizeof(::boost::STATIC_ASSERTION_FAILURE< ( B ) >) } + = sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >) } #endif //