pp_make_vector.hpp 3.9 KB

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