list_to_cons_call.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_TO_CONS_CALL_07192005_0138)
  8. #define FUSION_LIST_TO_CONS_CALL_07192005_0138
  9. #include <boost/preprocessor/iterate.hpp>
  10. #include <boost/preprocessor/repetition/enum_shifted_params.hpp>
  11. #include <boost/preprocessor/repetition/enum_binary_params.hpp>
  12. #define BOOST_PP_FILENAME_1 \
  13. <boost/fusion/container/list/detail/cpp03/list_to_cons_call.hpp>
  14. #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_LIST_SIZE)
  15. #include BOOST_PP_ITERATE()
  16. #endif
  17. #else // defined(BOOST_PP_IS_ITERATING)
  18. ///////////////////////////////////////////////////////////////////////////////
  19. //
  20. // Preprocessor vertical repetition code
  21. //
  22. ///////////////////////////////////////////////////////////////////////////////
  23. #define N BOOST_PP_ITERATION()
  24. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  25. static type
  26. call(BOOST_PP_ENUM_BINARY_PARAMS(
  27. N, typename detail::call_param<T, >::type arg))
  28. {
  29. return type(arg0
  30. #if N > 1
  31. , tail_list_to_cons::call(BOOST_PP_ENUM_SHIFTED_PARAMS(N, arg)));
  32. #else
  33. );
  34. #endif
  35. }
  36. #undef N
  37. #endif // defined(BOOST_PP_IS_ITERATING)