repeat.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef BOOST_MPL_AUX_PREPROCESSOR_REPEAT_HPP_INCLUDED
  2. #define BOOST_MPL_AUX_PREPROCESSOR_REPEAT_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2002-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. #if !defined(BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES)
  15. # include <boost/preprocessor/cat.hpp>
  16. # define BOOST_MPL_PP_REPEAT(n,f,param) \
  17. BOOST_PP_CAT(BOOST_MPL_PP_REPEAT_,n)(f,param) \
  18. /**/
  19. # define BOOST_MPL_PP_REPEAT_0(f,p)
  20. # define BOOST_MPL_PP_REPEAT_1(f,p) f(0,0,p)
  21. # define BOOST_MPL_PP_REPEAT_2(f,p) f(0,0,p) f(0,1,p)
  22. # define BOOST_MPL_PP_REPEAT_3(f,p) f(0,0,p) f(0,1,p) f(0,2,p)
  23. # define BOOST_MPL_PP_REPEAT_4(f,p) f(0,0,p) f(0,1,p) f(0,2,p) f(0,3,p)
  24. # define BOOST_MPL_PP_REPEAT_5(f,p) f(0,0,p) f(0,1,p) f(0,2,p) f(0,3,p) f(0,4,p)
  25. # define BOOST_MPL_PP_REPEAT_6(f,p) f(0,0,p) f(0,1,p) f(0,2,p) f(0,3,p) f(0,4,p) f(0,5,p)
  26. # define BOOST_MPL_PP_REPEAT_7(f,p) f(0,0,p) f(0,1,p) f(0,2,p) f(0,3,p) f(0,4,p) f(0,5,p) f(0,6,p)
  27. # define BOOST_MPL_PP_REPEAT_8(f,p) f(0,0,p) f(0,1,p) f(0,2,p) f(0,3,p) f(0,4,p) f(0,5,p) f(0,6,p) f(0,7,p)
  28. # define BOOST_MPL_PP_REPEAT_9(f,p) f(0,0,p) f(0,1,p) f(0,2,p) f(0,3,p) f(0,4,p) f(0,5,p) f(0,6,p) f(0,7,p) f(0,8,p)
  29. # define BOOST_MPL_PP_REPEAT_10(f,p) f(0,0,p) f(0,1,p) f(0,2,p) f(0,3,p) f(0,4,p) f(0,5,p) f(0,6,p) f(0,7,p) f(0,8,p) f(0,9,p)
  30. #else
  31. # include <boost/preprocessor/repeat.hpp>
  32. # define BOOST_MPL_PP_REPEAT(n,f,param) \
  33. BOOST_PP_REPEAT(n,f,param) \
  34. /**/
  35. #endif
  36. #define BOOST_MPL_PP_REPEAT_IDENTITY_FUNC(unused1, unused2, x) x
  37. #endif // BOOST_MPL_AUX_PREPROCESSOR_REPEAT_HPP_INCLUDED