deque_keyed_values_call.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*=============================================================================
  2. Copyright (c) 2005-2012 Joel de Guzman
  3. Copyright (c) 2005-2006 Dan Marsden
  4. Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. ==============================================================================*/
  7. #if !defined(BOOST_PP_IS_ITERATING)
  8. #if !defined(BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_KEYED_VALUES_CALL_04122006_2211)
  9. #define BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_KEYED_VALUES_CALL_04122006_2211
  10. #if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
  11. #error "C++03 only! This file should not have been included"
  12. #endif
  13. #include <boost/preprocessor/iterate.hpp>
  14. #include <boost/preprocessor/repetition/enum_shifted_params.hpp>
  15. #include <boost/preprocessor/repetition/enum_shifted.hpp>
  16. #include <boost/preprocessor/repetition/enum_binary_params.hpp>
  17. #define FUSION_HASH #
  18. #define FUSION_DEQUE_KEYED_VALUES_FORWARD(z, n, _) \
  19. BOOST_FUSION_FWD_ELEM(BOOST_PP_CAT(T_, n), BOOST_PP_CAT(t, n))
  20. #define BOOST_PP_FILENAME_1 \
  21. <boost/fusion/container/deque/detail/cpp03/deque_keyed_values_call.hpp>
  22. #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_DEQUE_SIZE)
  23. #include BOOST_PP_ITERATE()
  24. #undef FUSION_DEQUE_KEYED_VALUES_FORWARD
  25. #undef FUSION_HASH
  26. #endif
  27. #else
  28. #define N BOOST_PP_ITERATION()
  29. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  30. static type construct(BOOST_PP_ENUM_BINARY_PARAMS(N, typename detail::call_param<T, >::type t))
  31. {
  32. return type(t0,
  33. deque_keyed_values_impl<
  34. next_index
  35. #if N > 1
  36. , BOOST_PP_ENUM_SHIFTED_PARAMS(N, T)
  37. #endif
  38. >::construct(BOOST_PP_ENUM_SHIFTED_PARAMS(N, t)));
  39. }
  40. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  41. FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
  42. #endif
  43. #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
  44. (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
  45. template <BOOST_PP_ENUM_PARAMS(N, typename T_)>
  46. BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  47. static type forward_(BOOST_PP_ENUM_BINARY_PARAMS(N, T_, && t))
  48. {
  49. return type(BOOST_FUSION_FWD_ELEM(T_0, t0),
  50. deque_keyed_values_impl<
  51. next_index
  52. #if N > 1
  53. , BOOST_PP_ENUM_SHIFTED_PARAMS(N, T_)
  54. #endif
  55. >::forward_(BOOST_PP_ENUM_SHIFTED(N, FUSION_DEQUE_KEYED_VALUES_FORWARD, _)));
  56. }
  57. #endif
  58. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  59. FUSION_HASH endif
  60. #endif
  61. #undef N
  62. #endif