params.hpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef BOOST_MPL_AUX_PREPROCESSOR_PARAMS_HPP_INCLUDED
  2. #define BOOST_MPL_AUX_PREPROCESSOR_PARAMS_HPP_INCLUDED
  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. #include <boost/mpl/aux_/config/preprocessor.hpp>
  14. // BOOST_MPL_PP_PARAMS(0,T): <nothing>
  15. // BOOST_MPL_PP_PARAMS(1,T): T1
  16. // BOOST_MPL_PP_PARAMS(2,T): T1, T2
  17. // BOOST_MPL_PP_PARAMS(n,T): T1, T2, .., Tn
  18. #if !defined(BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES)
  19. # include <boost/preprocessor/cat.hpp>
  20. # define BOOST_MPL_PP_PARAMS(n,p) \
  21. BOOST_PP_CAT(BOOST_MPL_PP_PARAMS_,n)(p) \
  22. /**/
  23. # define BOOST_MPL_PP_PARAMS_0(p)
  24. # define BOOST_MPL_PP_PARAMS_1(p) p##1
  25. # define BOOST_MPL_PP_PARAMS_2(p) p##1,p##2
  26. # define BOOST_MPL_PP_PARAMS_3(p) p##1,p##2,p##3
  27. # define BOOST_MPL_PP_PARAMS_4(p) p##1,p##2,p##3,p##4
  28. # define BOOST_MPL_PP_PARAMS_5(p) p##1,p##2,p##3,p##4,p##5
  29. # define BOOST_MPL_PP_PARAMS_6(p) p##1,p##2,p##3,p##4,p##5,p##6
  30. # define BOOST_MPL_PP_PARAMS_7(p) p##1,p##2,p##3,p##4,p##5,p##6,p##7
  31. # define BOOST_MPL_PP_PARAMS_8(p) p##1,p##2,p##3,p##4,p##5,p##6,p##7,p##8
  32. # define BOOST_MPL_PP_PARAMS_9(p) p##1,p##2,p##3,p##4,p##5,p##6,p##7,p##8,p##9
  33. #else
  34. # include <boost/preprocessor/comma_if.hpp>
  35. # include <boost/preprocessor/repeat.hpp>
  36. # include <boost/preprocessor/inc.hpp>
  37. # include <boost/preprocessor/cat.hpp>
  38. # define BOOST_MPL_PP_AUX_PARAM_FUNC(unused, i, param) \
  39. BOOST_PP_COMMA_IF(i) \
  40. BOOST_PP_CAT(param, BOOST_PP_INC(i)) \
  41. /**/
  42. # define BOOST_MPL_PP_PARAMS(n, param) \
  43. BOOST_PP_REPEAT( \
  44. n \
  45. , BOOST_MPL_PP_AUX_PARAM_FUNC \
  46. , param \
  47. ) \
  48. /**/
  49. #endif
  50. #endif // BOOST_MPL_AUX_PREPROCESSOR_PARAMS_HPP_INCLUDED