Go to the documentation of this file.
2 #ifndef BOOST_MPL_ASSERT_HPP_INCLUDED
3 #define BOOST_MPL_ASSERT_HPP_INCLUDED
38 #if BOOST_WORKAROUND(BOOST_MSVC, == 1700)
42 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
43 || (BOOST_MPL_CFG_GCC != 0) \
44 || BOOST_WORKAROUND(__IBMCPP__, <= 600)
45 # define BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES
48 #if BOOST_WORKAROUND(__MWERKS__, < 0x3202) \
49 || BOOST_WORKAROUND(__EDG_VERSION__, <= 238) \
50 || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
51 || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
52 # define BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER
58 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
59 || (BOOST_MPL_CFG_GCC != 0) || (BOOST_MPL_CFG_GPU != 0)
60 # define BOOST_MPL_AUX_ASSERT_CONSTANT(T, expr) enum { expr }
62 # define BOOST_MPL_AUX_ASSERT_CONSTANT(T, expr) BOOST_STATIC_CONSTANT(T, expr)
73 #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
74 # define AUX778076_ASSERT_ARG(x) x&
76 # define AUX778076_ASSERT_ARG(x) x
79 template<
bool C >
struct assert {
typedef void*
type; };
94 static int failed(
void* );
99 #if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
100 template<
typename T1,
typename T2 = na,
typename T3 = na,
typename T4 = na >
struct types {};
107 #if !defined(BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES)
116 #if defined(__EDG_VERSION__)
117 template<
bool (*)(failed, failed),
long x,
long y >
struct assert_relation {};
118 # define BOOST_MPL_AUX_ASSERT_RELATION(x, y, r) assert_relation<r,x,y>
120 template< BOOST_MPL_AUX_NTTP_DECL(
long, x), BOOST_MPL_AUX_NTTP_DECL(
long, y),
bool (*)(failed, failed) >
122 # define BOOST_MPL_AUX_ASSERT_RELATION(x, y, r) assert_relation<x,y,r>
125 #else // BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES
134 template< assert_::relations r,
long x,
long y >
struct assert_relation {};
138 #if BOOST_WORKAROUND(BOOST_MSVC, == 1700)
141 struct extract_assert_pred;
144 struct extract_assert_pred<
void(Pred)> {
typedef Pred
type; };
149 typedef typename P::type p_type;
152 failed ************ P::************
157 struct eval_assert_not {
159 typedef typename P::type p_type;
166 template<
typename T >
169 #elif !defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER)
187 template<
typename Pred >
188 failed ************ (Pred::************
192 template<
typename Pred >
197 template<
typename Pred >
201 template<
typename Pred >
206 #else // BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER
208 template<
bool c,
typename Pred >
struct assert_arg_type_impl
210 typedef failed ************ Pred::* mwcw83_wknd;
211 typedef mwcw83_wknd *************
type;
214 template<
typename Pred >
struct assert_arg_type_impl<true,Pred>
219 template<
typename Pred >
struct assert_arg_type
220 : assert_arg_type_impl< BOOST_MPL_AUX_VALUE_WKND(BOOST_MPL_AUX_NESTED_TYPE_WKND(Pred))::value, Pred >
224 template<
typename Pred >
228 template<
typename Pred >
229 typename assert_arg_type< boost::mpl::not_<Pred> >
::type
232 # if !defined(BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES)
233 template<
long x,
long y,
bool (*r)(failed, failed) >
237 template< assert_::relations r,
long x,
long y >
238 typename assert_arg_type_impl< false,assert_relation<r,x,y> >
::type
242 #endif // BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER
244 #undef AUX778076_ASSERT_ARG
248 #if BOOST_WORKAROUND(BOOST_MSVC, == 1700)
252 #define BOOST_MPL_ASSERT(pred) \
253 BOOST_MPL_AUX_ASSERT_CONSTANT( \
255 , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
256 boost::mpl::assertion_failed<false>( \
257 boost::mpl::make_assert_arg< \
258 typename boost::mpl::eval_assert<void pred>::type \
267 #define BOOST_MPL_ASSERT_NOT(pred) \
268 BOOST_MPL_AUX_ASSERT_CONSTANT( \
270 , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
271 boost::mpl::assertion_failed<false>( \
272 boost::mpl::make_assert_arg< \
273 typename boost::mpl::eval_assert_not<void pred>::type \
284 #define BOOST_MPL_ASSERT(pred) \
285 BOOST_MPL_AUX_ASSERT_CONSTANT( \
287 , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
288 boost::mpl::assertion_failed<false>( \
289 boost::mpl::assert_arg( (void (*) pred)0, 1 ) \
297 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
298 # define BOOST_MPL_ASSERT_NOT(pred) \
300 BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
301 boost::mpl::assertion<false>::failed( \
302 boost::mpl::assert_not_arg( (void (*) pred)0, 1 ) \
308 # define BOOST_MPL_ASSERT_NOT(pred) \
309 BOOST_MPL_AUX_ASSERT_CONSTANT( \
311 , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
312 boost::mpl::assertion_failed<false>( \
313 boost::mpl::assert_not_arg( (void (*) pred)0, 1 ) \
324 #if defined(BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES)
326 # if !defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER)
328 # define BOOST_MPL_ASSERT_RELATION_IMPL(counter, x, rel, y) \
329 enum { BOOST_PP_CAT(mpl_assert_rel_value,counter) = (x rel y) }; \
330 BOOST_MPL_AUX_ASSERT_CONSTANT( \
332 , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \
333 boost::mpl::assertion_failed<BOOST_PP_CAT(mpl_assert_rel_value,counter)>( \
334 (boost::mpl::failed ************ ( boost::mpl::assert_relation< \
335 boost::mpl::assert_::relations( sizeof( \
336 boost::mpl::assert_::arg rel boost::mpl::assert_::arg \
340 >::************)) 0 ) \
345 # define BOOST_MPL_ASSERT_RELATION_IMPL(counter, x, rel, y) \
346 BOOST_MPL_AUX_ASSERT_CONSTANT( \
348 , BOOST_PP_CAT(mpl_assert_rel,counter) = sizeof( \
349 boost::mpl::assert_::arg rel boost::mpl::assert_::arg \
352 BOOST_MPL_AUX_ASSERT_CONSTANT( bool, BOOST_PP_CAT(mpl_assert_rel_value,counter) = (x rel y) ); \
353 BOOST_MPL_AUX_ASSERT_CONSTANT( \
355 , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \
356 boost::mpl::assertion_failed<BOOST_PP_CAT(mpl_assert_rel_value,counter)>( \
357 boost::mpl::assert_rel_arg( boost::mpl::assert_relation< \
358 boost::mpl::assert_::relations(BOOST_PP_CAT(mpl_assert_rel,counter)) \
368 # define BOOST_MPL_ASSERT_RELATION(x, rel, y) \
369 BOOST_MPL_ASSERT_RELATION_IMPL(BOOST_MPL_AUX_PP_COUNTER(), x, rel, y) \
372 #else // !BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES
374 # if defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER)
375 # define BOOST_MPL_ASSERT_RELATION(x, rel, y) \
376 BOOST_MPL_AUX_ASSERT_CONSTANT( \
378 , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
379 boost::mpl::assertion_failed<(x rel y)>( boost::mpl::assert_rel_arg( \
380 boost::mpl::BOOST_MPL_AUX_ASSERT_RELATION(x,y,(&boost::mpl::operator rel))() \
386 # define BOOST_MPL_ASSERT_RELATION(x, rel, y) \
387 BOOST_MPL_AUX_ASSERT_CONSTANT( \
389 , BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
390 boost::mpl::assertion_failed<(x rel y)>( (boost::mpl::failed ************ ( \
391 boost::mpl::BOOST_MPL_AUX_ASSERT_RELATION(x,y,(&boost::mpl::operator rel))::************))0 ) \
402 #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202))
403 # define BOOST_MPL_ASSERT_MSG_IMPL( counter, c, msg, types_ ) \
405 typedef struct BOOST_PP_CAT(msg,counter) : boost::mpl::assert_ \
407 using boost::mpl::assert_::types; \
408 static boost::mpl::failed ************ (msg::************ assert_arg()) types_ \
410 } BOOST_PP_CAT(mpl_assert_arg,counter); \
411 BOOST_MPL_AUX_ASSERT_CONSTANT( \
413 , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \
414 boost::mpl::assertion<(c)>::failed( BOOST_PP_CAT(mpl_assert_arg,counter)::assert_arg() ) \
419 # define BOOST_MPL_ASSERT_MSG_IMPL( counter, c, msg, types_ ) \
421 typedef struct BOOST_PP_CAT(msg,counter) : boost::mpl::assert_ \
423 static boost::mpl::failed ************ (msg::************ assert_arg()) types_ \
425 } BOOST_PP_CAT(mpl_assert_arg,counter); \
426 BOOST_MPL_AUX_ASSERT_CONSTANT( \
428 , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \
429 boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,counter)::assert_arg() ) \
435 #define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
436 BOOST_MPL_ASSERT_MSG_IMPL( BOOST_MPL_AUX_PP_COUNTER(), c, msg, types_ ) \
439 #endif // BOOST_MPL_ASSERT_HPP_INCLUDED
#define AUX778076_ASSERT_ARG(x)
assert_arg_pred_impl< p >::type type
assert_arg_pred_impl< p_type::value >::type type
bool operator<=(failed, failed)
typedef void(APIENTRY *GLDEBUGPROC)(GLenum source
#define BOOST_MPL_AUX_ASSERT_RELATION(x, y, r)
bool operator!=(failed, failed)
bool operator==(failed, failed)
failed ************boost::mpl::not_< Pred >::************ assert_not_arg(void(*)(Pred), typename assert_arg_pred_not< Pred >::type)
bool operator>(failed, failed)
static int failed(assert< false >)
#define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
failed ************Pred::************ assert_arg(void(*)(Pred), typename assert_arg_pred< Pred >::type)
int assertion_failed(typename assert< C >::type)
bool operator<(failed, failed)
#define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
bool operator>=(failed, failed)
BOOST_MPL_AUX_ASSERT_CONSTANT(bool, p=!p_type::value)
librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Thu Dec 22 2022 03:13:13