pp_make_map.hpp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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_PP_MAKE_MAP_07222005_1247)
  8. #define FUSION_PP_MAKE_MAP_07222005_1247
  9. #include <boost/preprocessor/iterate.hpp>
  10. #include <boost/preprocessor/repetition/enum_params.hpp>
  11. #include <boost/preprocessor/repetition/enum_binary_params.hpp>
  12. #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
  13. #include <boost/preprocessor/repetition/repeat_from_to.hpp>
  14. #include <boost/fusion/container/map/map.hpp>
  15. #include <boost/fusion/support/detail/as_fusion_element.hpp>
  16. #include <boost/fusion/support/pair.hpp>
  17. #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
  18. #include <boost/fusion/container/generation/detail/preprocessed/make_map.hpp>
  19. #else
  20. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  21. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_map" FUSION_MAX_MAP_SIZE_STR".hpp")
  22. #endif
  23. /*=============================================================================
  24. Copyright (c) 2001-2011 Joel de Guzman
  25. Distributed under the Boost Software License, Version 1.0. (See accompanying
  26. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  27. This is an auto-generated file. Do not edit!
  28. ==============================================================================*/
  29. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  30. #pragma wave option(preserve: 1)
  31. #endif
  32. namespace boost { namespace fusion
  33. {
  34. struct void_;
  35. namespace result_of
  36. {
  37. template <
  38. BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
  39. FUSION_MAX_VECTOR_SIZE, typename K, void_)
  40. , BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
  41. FUSION_MAX_VECTOR_SIZE, typename D, void_)
  42. , typename Extra = void_
  43. >
  44. struct make_map;
  45. template <>
  46. struct make_map<>
  47. {
  48. typedef map<> type;
  49. };
  50. }
  51. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  52. inline map<>
  53. make_map()
  54. {
  55. return map<>();
  56. }
  57. #define BOOST_FUSION_PAIR(z, n, data) \
  58. fusion::pair< \
  59. BOOST_PP_CAT(K, n) \
  60. , typename detail::as_fusion_element<BOOST_PP_CAT(D, n)>::type>
  61. #define BOOST_FUSION_MAKE_PAIR(z, n, _) \
  62. fusion::make_pair<BOOST_PP_CAT(K, n)>(BOOST_PP_CAT(_, n)) \
  63. #define BOOST_PP_FILENAME_1 <boost/fusion/container/generation/detail/pp_make_map.hpp>
  64. #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE)
  65. #include BOOST_PP_ITERATE()
  66. #undef BOOST_FUSION_PAIR
  67. #undef BOOST_FUSION_MAKE_PAIR
  68. }}
  69. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  70. #pragma wave option(output: null)
  71. #endif
  72. #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
  73. #endif
  74. #else // defined(BOOST_PP_IS_ITERATING)
  75. ///////////////////////////////////////////////////////////////////////////////
  76. //
  77. // Preprocessor vertical repetition code
  78. //
  79. ///////////////////////////////////////////////////////////////////////////////
  80. #define N BOOST_PP_ITERATION()
  81. namespace result_of
  82. {
  83. template <
  84. BOOST_PP_ENUM_PARAMS(N, typename K)
  85. , BOOST_PP_ENUM_PARAMS(N, typename D)
  86. >
  87. #define TEXT(z, n, text) , text
  88. struct make_map<BOOST_PP_ENUM_PARAMS(N, K), BOOST_PP_ENUM_PARAMS(N, D) BOOST_PP_REPEAT_FROM_TO(N, FUSION_MAX_VECTOR_SIZE, TEXT, void_) BOOST_PP_REPEAT_FROM_TO(BOOST_PP_DEC(N), FUSION_MAX_VECTOR_SIZE, TEXT, void_)>
  89. #undef TEXT
  90. {
  91. typedef map<BOOST_PP_ENUM(N, BOOST_FUSION_PAIR, _)> type;
  92. };
  93. }
  94. template <
  95. BOOST_PP_ENUM_PARAMS(N, typename K)
  96. , BOOST_PP_ENUM_PARAMS(N, typename D)
  97. >
  98. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  99. inline map<BOOST_PP_ENUM(N, BOOST_FUSION_PAIR, _)>
  100. make_map(BOOST_PP_ENUM_BINARY_PARAMS(N, D, const& arg))
  101. {
  102. return map<BOOST_PP_ENUM(N, BOOST_FUSION_PAIR, _)>(
  103. BOOST_PP_ENUM(N, BOOST_FUSION_MAKE_PAIR, arg));
  104. }
  105. #undef N
  106. #endif // defined(BOOST_PP_IS_ITERATING)