From 8c3f43daeb604c8727001a62f6cc87363465bac9 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 8 Sep 2004 17:47:27 +0000 Subject: [PATCH] Workaround cw bug (from branch). [SVN r24977] --- include/boost/mpl/assert.hpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/include/boost/mpl/assert.hpp b/include/boost/mpl/assert.hpp index 4d72b02..0871969 100644 --- a/include/boost/mpl/assert.hpp +++ b/include/boost/mpl/assert.hpp @@ -61,6 +61,19 @@ template<> struct assert { typedef AUX778076_ASSERT_ARG(assert) template< bool C > int assertion_failed( typename assert::type ); +template +struct assertion +{ + static int failed(assert); +}; + +template <> +struct assertion +{ + template + static int failed(T); +}; + struct assert_ { #if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES) @@ -272,16 +285,18 @@ enum { \ // BOOST_MPL_ASSERT_MSG( (pred::value), USER_PROVIDED_MESSAGE, (types) ) -# define BOOST_MPL_ASSERT_MSG( c, msg, types ) \ +# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \ struct msg; \ typedef struct BOOST_PP_CAT(msg,__LINE__) : boost::mpl::assert_ \ { \ - static boost::mpl::failed **************** (msg::**************** assert_arg()) types \ + using boost::mpl::assert_::types; \ + enum { msg }; \ + static boost::mpl::failed ************ (msg::************ assert_arg()) types_ \ { return 0; } \ } BOOST_PP_CAT(mpl_assert_arg,__LINE__); \ enum { \ BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ - boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,__LINE__)::assert_arg() ) \ + boost::mpl::assertion<(c)>::failed( BOOST_PP_CAT(mpl_assert_arg,__LINE__)::assert_arg() ) \ ) \ }\ /**/