numbered.hpp 1.3 KB

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