params.hpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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_Z(z_ignored,n,p) \
  24. BOOST_PP_CAT(BOOST_MPL_PP_PARAMS_,n)(p) \
  25. /**/
  26. # define BOOST_MPL_PP_PARAMS_0(p)
  27. # define BOOST_MPL_PP_PARAMS_1(p) p##1
  28. # define BOOST_MPL_PP_PARAMS_2(p) p##1,p##2
  29. # define BOOST_MPL_PP_PARAMS_3(p) p##1,p##2,p##3
  30. # define BOOST_MPL_PP_PARAMS_4(p) p##1,p##2,p##3,p##4
  31. # define BOOST_MPL_PP_PARAMS_5(p) p##1,p##2,p##3,p##4,p##5
  32. # define BOOST_MPL_PP_PARAMS_6(p) p##1,p##2,p##3,p##4,p##5,p##6
  33. # define BOOST_MPL_PP_PARAMS_7(p) p##1,p##2,p##3,p##4,p##5,p##6,p##7
  34. # define BOOST_MPL_PP_PARAMS_8(p) p##1,p##2,p##3,p##4,p##5,p##6,p##7,p##8
  35. # 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
  36. #else
  37. # include <boost/preprocessor/comma_if.hpp>
  38. # include <boost/preprocessor/repeat.hpp>
  39. # include <boost/preprocessor/inc.hpp>
  40. # include <boost/preprocessor/cat.hpp>
  41. # define BOOST_MPL_PP_AUX_PARAM_FUNC(unused, i, param) \
  42. BOOST_PP_COMMA_IF(i) \
  43. BOOST_PP_CAT(param, BOOST_PP_INC(i)) \
  44. /**/
  45. # define BOOST_MPL_PP_PARAMS(n, param) \
  46. BOOST_PP_REPEAT( \
  47. n \
  48. , BOOST_MPL_PP_AUX_PARAM_FUNC \
  49. , param \
  50. ) \
  51. /**/
  52. # define BOOST_MPL_PP_PARAMS_Z(z, n, param) \
  53. BOOST_PP_REPEAT_ ## z( \
  54. n \
  55. , BOOST_MPL_PP_AUX_PARAM_FUNC \
  56. , param \
  57. ) \
  58. /**/
  59. #endif
  60. #endif // BOOST_MPL_AUX_PREPROCESSOR_PARAMS_HPP_INCLUDED