numbered_c.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
  2. // Copyright Aleksey Gurtovoy 2000-2004
  3. //
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // See http://www.boost.org/libs/mpl for documentation.
  9. // $Id$
  10. // $Date$
  11. // $Revision$
  12. #if defined(BOOST_PP_IS_ITERATING)
  13. #include <boost/preprocessor/enum_params.hpp>
  14. #include <boost/preprocessor/enum_shifted_params.hpp>
  15. #include <boost/preprocessor/dec.hpp>
  16. #include <boost/preprocessor/cat.hpp>
  17. #define i BOOST_PP_FRAME_ITERATION(1)
  18. #if i == 1
  19. template<
  20. typename T
  21. , BOOST_PP_ENUM_PARAMS(i, T C)
  22. >
  23. struct list1_c
  24. : l_item<
  25. long_<1>
  26. , integral_c<T,C0>
  27. , l_end
  28. >
  29. {
  30. typedef list1_c type;
  31. typedef T value_type;
  32. };
  33. #else
  34. # define MPL_AUX_LIST_C_TAIL(list, i, C) \
  35. BOOST_PP_CAT(BOOST_PP_CAT(list,BOOST_PP_DEC(i)),_c)<T, \
  36. BOOST_PP_ENUM_SHIFTED_PARAMS(i, C) \
  37. > \
  38. /**/
  39. template<
  40. typename T
  41. , BOOST_PP_ENUM_PARAMS(i, T C)
  42. >
  43. struct BOOST_PP_CAT(BOOST_PP_CAT(list,i),_c)
  44. : l_item<
  45. long_<i>
  46. , integral_c<T,C0>
  47. , MPL_AUX_LIST_C_TAIL(list,i,C)
  48. >
  49. {
  50. typedef BOOST_PP_CAT(BOOST_PP_CAT(list,i),_c) type;
  51. typedef T value_type;
  52. };
  53. # undef MPL_AUX_LIST_C_TAIL
  54. #endif // i == 1
  55. #undef i
  56. #endif // BOOST_PP_IS_ITERATING