increased_arity.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright Bruno Dutra 2015
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/mpl for documentation.
  8. // $Id$
  9. // $Date$
  10. // $Revision$
  11. #define BOOST_MPL_LIMIT_METAFUNCTION_ARITY 15
  12. #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
  13. #include <boost/mpl/logical.hpp>
  14. #include <boost/mpl/placeholders.hpp>
  15. #include <boost/mpl/apply.hpp>
  16. #include <boost/mpl/aux_/test.hpp>
  17. #include <boost/preprocessor/inc.hpp>
  18. #include <boost/preprocessor/repeat_from_to.hpp>
  19. #include <boost/preprocessor/enum_params.hpp>
  20. #include <boost/preprocessor/facilities/intercept.hpp>
  21. #define TEST_N_ARY(unused1, N, unused2) \
  22. static_assert_< \
  23. apply< \
  24. and_<BOOST_PP_ENUM_PARAMS(N, _ BOOST_PP_INTERCEPT)>, \
  25. BOOST_PP_ENUM_PARAMS(N, true_ BOOST_PP_INTERCEPT) \
  26. > \
  27. >(); \
  28. /**/
  29. template<typename assertion>
  30. void static_assert_(){
  31. MPL_ASSERT((typename assertion::type));
  32. }
  33. MPL_TEST_CASE()
  34. {
  35. BOOST_PP_REPEAT_FROM_TO(
  36. 2,
  37. BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY),
  38. TEST_N_ARY,
  39. _
  40. )
  41. }