list_forward_ctor.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #ifndef BOOST_PP_IS_ITERATING
  7. #if !defined(FUSION_LIST_FORWARD_CTOR_07172005_0113)
  8. #define FUSION_LIST_FORWARD_CTOR_07172005_0113
  9. #include <boost/preprocessor/iterate.hpp>
  10. #include <boost/preprocessor/cat.hpp>
  11. #include <boost/preprocessor/repetition/enum_shifted.hpp>
  12. #include <boost/preprocessor/repetition/enum_binary_params.hpp>
  13. #include <boost/preprocessor/repetition/repeat.hpp>
  14. #define FUSION_LIST_CTOR_MAKE_CONS(z, n, type) tie_cons(BOOST_PP_CAT(_, n)
  15. #define FUSION_LIST_CL_PAREN(z, n, type) )
  16. #define BOOST_PP_FILENAME_1 \
  17. <boost/fusion/container/list/detail/cpp03/list_forward_ctor.hpp>
  18. #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_LIST_SIZE)
  19. #include BOOST_PP_ITERATE()
  20. #undef FUSION_LIST_CTOR_MAKE_CONS
  21. #undef FUSION_LIST_CL_PAREN
  22. #endif
  23. #else // defined(BOOST_PP_IS_ITERATING)
  24. ///////////////////////////////////////////////////////////////////////////////
  25. //
  26. // Preprocessor vertical repetition code
  27. //
  28. ///////////////////////////////////////////////////////////////////////////////
  29. #define N BOOST_PP_ITERATION()
  30. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  31. #if N == 1
  32. explicit
  33. #endif
  34. list(BOOST_PP_ENUM_BINARY_PARAMS(
  35. N, typename detail::call_param<T, >::type arg))
  36. : inherited_type(list_to_cons::call(BOOST_PP_ENUM_PARAMS(N, arg)))
  37. {}
  38. #undef N
  39. #endif // defined(BOOST_PP_IS_ITERATING)