00001 #
00002
00003
00004
00005
00006
00007
00008
00009 #
00010 #
00011 #
00012 #
00013 #
00014 # ifndef BOOST_PREPROCESSOR_ARITHMETIC_ADD_HPP
00015 # define BOOST_PREPROCESSOR_ARITHMETIC_ADD_HPP
00016 #
00017 # include <boost/preprocessor/arithmetic/dec.hpp>
00018 # include <boost/preprocessor/arithmetic/inc.hpp>
00019 # include <boost/preprocessor/config/config.hpp>
00020 # include <boost/preprocessor/control/while.hpp>
00021 # include <boost/preprocessor/tuple/elem.hpp>
00022 #
00023 #
00024 #
00025 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
00026 # define BOOST_PP_ADD(x, y) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE(BOOST_PP_ADD_P, BOOST_PP_ADD_O, (x, y)))
00027 # else
00028 # define BOOST_PP_ADD(x, y) BOOST_PP_ADD_I(x, y)
00029 # define BOOST_PP_ADD_I(x, y) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE(BOOST_PP_ADD_P, BOOST_PP_ADD_O, (x, y)))
00030 # endif
00031 #
00032 # define BOOST_PP_ADD_P(d, xy) BOOST_PP_TUPLE_ELEM(2, 1, xy)
00033 #
00034 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
00035 # define BOOST_PP_ADD_O(d, xy) BOOST_PP_ADD_O_I xy
00036 # else
00037 # define BOOST_PP_ADD_O(d, xy) BOOST_PP_ADD_O_I(BOOST_PP_TUPLE_ELEM(2, 0, xy), BOOST_PP_TUPLE_ELEM(2, 1, xy))
00038 # endif
00039 #
00040 # define BOOST_PP_ADD_O_I(x, y) (BOOST_PP_INC(x), BOOST_PP_DEC(y))
00041 #
00042 #
00043 #
00044 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
00045 # define BOOST_PP_ADD_D(d, x, y) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_ADD_P, BOOST_PP_ADD_O, (x, y)))
00046 # else
00047 # define BOOST_PP_ADD_D(d, x, y) BOOST_PP_ADD_D_I(d, x, y)
00048 # define BOOST_PP_ADD_D_I(d, x, y) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_ADD_P, BOOST_PP_ADD_O, (x, y)))
00049 # endif
00050 #
00051 # endif