X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=boost%2Fmpl%2Fassert.hpp;fp=boost%2Fmpl%2Fassert.hpp;h=7a5818e9e4b2dc1770d7ffde8ee4f3d70304998a;hp=33b82f3ffa11ab3a49cef1d93ac3f00b611d9d2d;hb=2d71eb92104693ca9baa5a2e1c23eeca776d8fd3;hpb=da57529b92adbb7ae74a89861cb39fb35ac7c62d diff --git a/boost/mpl/assert.hpp b/boost/mpl/assert.hpp index 33b82f3..7a5818e 100644 --- a/boost/mpl/assert.hpp +++ b/boost/mpl/assert.hpp @@ -10,9 +10,9 @@ // // See http://www.boost.org/libs/mpl for documentation. -// $Id: assert.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ -// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ -// $Revision: 49267 $ +// $Id: assert.hpp 86514 2013-10-29 13:15:03Z bemandawes $ +// $Date: 2013-10-29 06:15:03 -0700 (Tue, 29 Oct 2013) $ +// $Revision: 86514 $ #include #include @@ -34,6 +34,9 @@ #include // make sure 'size_t' is placed into 'std' #include +#if BOOST_WORKAROUND(BOOST_MSVC, == 1700) +#include +#endif #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \ || (BOOST_MPL_CFG_GCC != 0) \ @@ -131,8 +134,38 @@ template< assert_::relations r, long x, long y > struct assert_relation {}; #endif +#if BOOST_WORKAROUND(BOOST_MSVC, == 1700) + +template +struct extract_assert_pred; + +template +struct extract_assert_pred { typedef Pred type; }; + +template +struct eval_assert { + typedef typename extract_assert_pred::type P; + typedef typename P::type p_type; + typedef typename ::boost::mpl::if_c), + failed ************ P::************ + >::type type; +}; + +template +struct eval_assert_not { + typedef typename extract_assert_pred::type P; + typedef typename P::type p_type; + typedef typename ::boost::mpl::if_c), + failed ************ ::boost::mpl::not_

::************ + >::type type; +}; + +template< typename T > +T make_assert_arg(); -#if !defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER) +#elif !defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER) template< bool > struct assert_arg_pred_impl { typedef int type; }; template<> struct assert_arg_pred_impl { typedef void* type; }; @@ -211,6 +244,39 @@ assert_rel_arg( assert_relation ); BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE +#if BOOST_WORKAROUND(BOOST_MSVC, == 1700) + +// BOOST_MPL_ASSERT((pred)) + +#define BOOST_MPL_ASSERT(pred) \ +BOOST_MPL_AUX_ASSERT_CONSTANT( \ + std::size_t \ + , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ + boost::mpl::assertion_failed( \ + boost::mpl::make_assert_arg< \ + typename boost::mpl::eval_assert::type \ + >() \ + ) \ + ) \ + ) \ +/**/ + +// BOOST_MPL_ASSERT_NOT((pred)) + +#define BOOST_MPL_ASSERT_NOT(pred) \ +BOOST_MPL_AUX_ASSERT_CONSTANT( \ + std::size_t \ + , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \ + boost::mpl::assertion_failed( \ + boost::mpl::make_assert_arg< \ + typename boost::mpl::eval_assert_not::type \ + >() \ + ) \ + ) \ + ) \ +/**/ + +#else // BOOST_MPL_ASSERT((pred)) @@ -250,6 +316,8 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \ /**/ #endif +#endif + // BOOST_MPL_ASSERT_RELATION(x, ==|!=|<=|<|>=|>, y) #if defined(BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES)