vector_n_chooser.hpp 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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_VECTOR_N_CHOOSER_07072005_1248)
  8. #define FUSION_VECTOR_N_CHOOSER_07072005_1248
  9. #include <boost/fusion/container/vector/detail/cpp03/limits.hpp>
  10. // include vector0..N where N is FUSION_MAX_VECTOR_SIZE
  11. #include <boost/fusion/container/vector/detail/cpp03/vector10.hpp>
  12. #if (FUSION_MAX_VECTOR_SIZE > 10)
  13. #include <boost/fusion/container/vector/detail/cpp03/vector20.hpp>
  14. #endif
  15. #if (FUSION_MAX_VECTOR_SIZE > 20)
  16. #include <boost/fusion/container/vector/detail/cpp03/vector30.hpp>
  17. #endif
  18. #if (FUSION_MAX_VECTOR_SIZE > 30)
  19. #include <boost/fusion/container/vector/detail/cpp03/vector40.hpp>
  20. #endif
  21. #if (FUSION_MAX_VECTOR_SIZE > 40)
  22. #include <boost/fusion/container/vector/detail/cpp03/vector50.hpp>
  23. #endif
  24. #include <boost/preprocessor/cat.hpp>
  25. #include <boost/preprocessor/arithmetic/dec.hpp>
  26. #include <boost/preprocessor/arithmetic/sub.hpp>
  27. #include <boost/preprocessor/facilities/intercept.hpp>
  28. #include <boost/preprocessor/repetition/enum_params.hpp>
  29. #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
  30. namespace boost { namespace fusion
  31. {
  32. struct void_;
  33. }}
  34. #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
  35. #include <boost/fusion/container/vector/detail/cpp03/preprocessed/vector_chooser.hpp>
  36. #else
  37. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  38. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/vector_chooser" FUSION_MAX_VECTOR_SIZE_STR ".hpp")
  39. #endif
  40. /*=============================================================================
  41. Copyright (c) 2001-2011 Joel de Guzman
  42. Distributed under the Boost Software License, Version 1.0. (See accompanying
  43. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  44. This is an auto-generated file. Do not edit!
  45. ==============================================================================*/
  46. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  47. #pragma wave option(preserve: 1)
  48. #endif
  49. namespace boost { namespace fusion { namespace detail
  50. {
  51. template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, typename T)>
  52. struct vector_n_chooser
  53. {
  54. typedef BOOST_PP_CAT(vector, FUSION_MAX_VECTOR_SIZE)<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)> type;
  55. };
  56. template <>
  57. struct vector_n_chooser<BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, void_ BOOST_PP_INTERCEPT)>
  58. {
  59. typedef vector0<> type;
  60. };
  61. #define BOOST_PP_FILENAME_1 \
  62. <boost/fusion/container/vector/detail/cpp03/vector_n_chooser.hpp>
  63. #define BOOST_PP_ITERATION_LIMITS (1, BOOST_PP_DEC(FUSION_MAX_VECTOR_SIZE))
  64. #include BOOST_PP_ITERATE()
  65. }}}
  66. #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
  67. #pragma wave option(output: null)
  68. #endif
  69. #endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
  70. #endif
  71. ///////////////////////////////////////////////////////////////////////////////
  72. //
  73. // Preprocessor vertical repetition code
  74. //
  75. ///////////////////////////////////////////////////////////////////////////////
  76. #else // defined(BOOST_PP_IS_ITERATING)
  77. #define N BOOST_PP_ITERATION()
  78. template <BOOST_PP_ENUM_PARAMS(N, typename T)>
  79. struct vector_n_chooser<
  80. BOOST_PP_ENUM_PARAMS(N, T)
  81. BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(FUSION_MAX_VECTOR_SIZE, N), void_ BOOST_PP_INTERCEPT)>
  82. {
  83. typedef BOOST_PP_CAT(vector, N)<BOOST_PP_ENUM_PARAMS(N, T)> type;
  84. };
  85. #undef N
  86. #endif // defined(BOOST_PP_IS_ITERATING)