pp_make_set.hpp 4.2 KB

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