add.hpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef BOOST_MPL_AUX_PREPROCESSOR_ADD_HPP_INCLUDED
  2. #define BOOST_MPL_AUX_PREPROCESSOR_ADD_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/mpl/aux_/preprocessor/tuple.hpp>
  16. #if defined(BOOST_MPL_CFG_BROKEN_PP_MACRO_EXPANSION)
  17. # include <boost/preprocessor/cat.hpp>
  18. # define BOOST_MPL_PP_ADD(i,j) \
  19. BOOST_MPL_PP_ADD_DELAY(i,j) \
  20. /**/
  21. # define BOOST_MPL_PP_ADD_DELAY(i,j) \
  22. BOOST_PP_CAT(BOOST_MPL_PP_TUPLE_11_ELEM_##i,BOOST_MPL_PP_ADD_##j) \
  23. /**/
  24. #else
  25. # define BOOST_MPL_PP_ADD(i,j) \
  26. BOOST_MPL_PP_ADD_DELAY(i,j) \
  27. /**/
  28. # define BOOST_MPL_PP_ADD_DELAY(i,j) \
  29. BOOST_MPL_PP_TUPLE_11_ELEM_##i BOOST_MPL_PP_ADD_##j \
  30. /**/
  31. #endif
  32. # define BOOST_MPL_PP_ADD_0 (0,1,2,3,4,5,6,7,8,9,10)
  33. # define BOOST_MPL_PP_ADD_1 (1,2,3,4,5,6,7,8,9,10,0)
  34. # define BOOST_MPL_PP_ADD_2 (2,3,4,5,6,7,8,9,10,0,0)
  35. # define BOOST_MPL_PP_ADD_3 (3,4,5,6,7,8,9,10,0,0,0)
  36. # define BOOST_MPL_PP_ADD_4 (4,5,6,7,8,9,10,0,0,0,0)
  37. # define BOOST_MPL_PP_ADD_5 (5,6,7,8,9,10,0,0,0,0,0)
  38. # define BOOST_MPL_PP_ADD_6 (6,7,8,9,10,0,0,0,0,0,0)
  39. # define BOOST_MPL_PP_ADD_7 (7,8,9,10,0,0,0,0,0,0,0)
  40. # define BOOST_MPL_PP_ADD_8 (8,9,10,0,0,0,0,0,0,0,0)
  41. # define BOOST_MPL_PP_ADD_9 (9,10,0,0,0,0,0,0,0,0,0)
  42. # define BOOST_MPL_PP_ADD_10 (10,0,0,0,0,0,0,0,0,0,0)
  43. #else
  44. # include <boost/preprocessor/arithmetic/add.hpp>
  45. # define BOOST_MPL_PP_ADD(i,j) \
  46. BOOST_PP_ADD(i,j) \
  47. /**/
  48. #endif
  49. #endif // BOOST_MPL_AUX_PREPROCESSOR_ADD_HPP_INCLUDED