Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/preprocessor/arithmetic/add.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 # /* Copyright (C) 2001
0002 #  * Housemarque Oy
0003 #  * http://www.housemarque.com
0004 #  *
0005 #  * Distributed under the Boost Software License, Version 1.0. (See
0006 #  * accompanying file LICENSE_1_0.txt or copy at
0007 #  * http://www.boost.org/LICENSE_1_0.txt)
0008 #  */
0009 #
0010 # /* Revised by Paul Mensonides (2002) */
0011 # /* Revised by Edward Diener (2020) */
0012 #
0013 # /* See http://www.boost.org for most recent version. */
0014 #
0015 # ifndef BOOST_PREPROCESSOR_ARITHMETIC_ADD_HPP
0016 # define BOOST_PREPROCESSOR_ARITHMETIC_ADD_HPP
0017 #
0018 # include <boost/preprocessor/config/config.hpp>
0019 #
0020 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
0021 #
0022 # include <boost/preprocessor/arithmetic/dec.hpp>
0023 # include <boost/preprocessor/arithmetic/inc.hpp>
0024 # include <boost/preprocessor/control/while.hpp>
0025 # include <boost/preprocessor/tuple/elem.hpp>
0026 #
0027 # /* BOOST_PP_ADD */
0028 #
0029 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0030 #    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)))
0031 # else
0032 #    define BOOST_PP_ADD(x, y) BOOST_PP_ADD_I(x, y)
0033 #    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)))
0034 # endif
0035 #
0036 # define BOOST_PP_ADD_P(d, xy) BOOST_PP_TUPLE_ELEM(2, 1, xy)
0037 #
0038 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
0039 #    define BOOST_PP_ADD_O(d, xy) BOOST_PP_ADD_O_I xy
0040 # else
0041 #    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))
0042 # endif
0043 #
0044 # define BOOST_PP_ADD_O_I(x, y) (BOOST_PP_INC(x), BOOST_PP_DEC(y))
0045 #
0046 # /* BOOST_PP_ADD_D */
0047 #
0048 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0049 #    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)))
0050 # else
0051 #    define BOOST_PP_ADD_D(d, x, y) BOOST_PP_ADD_D_I(d, x, y)
0052 #    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)))
0053 # endif
0054 #
0055 # else
0056 #
0057 # include <boost/preprocessor/arithmetic/dec.hpp>
0058 # include <boost/preprocessor/arithmetic/inc.hpp>
0059 # include <boost/preprocessor/control/iif.hpp>
0060 # include <boost/preprocessor/control/while.hpp>
0061 # include <boost/preprocessor/facilities/identity.hpp>
0062 # include <boost/preprocessor/logical/bitand.hpp>
0063 # include <boost/preprocessor/logical/bitor.hpp>
0064 # include <boost/preprocessor/logical/bool.hpp>
0065 # include <boost/preprocessor/logical/compl.hpp>
0066 # include <boost/preprocessor/tuple/elem.hpp>
0067 # include <boost/preprocessor/arithmetic/detail/is_maximum_number.hpp>
0068 # include <boost/preprocessor/arithmetic/detail/is_minimum_number.hpp>
0069 #
0070 # /* BOOST_PP_ADD */
0071 #
0072 #    define BOOST_PP_ADD(x, y) BOOST_PP_IIF(BOOST_PP_BITOR(BOOST_PP_DETAIL_IS_MAXIMUM_NUMBER(y),BOOST_PP_DETAIL_IS_MINIMUM_NUMBER(x)),BOOST_PP_IDENTITY_N(y,2),BOOST_PP_ADD_DO)(x,y)
0073 #
0074 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0075 #    define BOOST_PP_ADD_DO(x, y) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE(BOOST_PP_ADD_P, BOOST_PP_ADD_O, (x, y)))
0076 # else
0077 #    define BOOST_PP_ADD_DO(x, y) BOOST_PP_ADD_I(x, y)
0078 #    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)))
0079 # endif
0080 #
0081 # define BOOST_PP_ADD_P(d, xy) BOOST_PP_BITAND(BOOST_PP_BOOL(BOOST_PP_TUPLE_ELEM(2, 1, xy)),BOOST_PP_COMPL(BOOST_PP_DETAIL_IS_MAXIMUM_NUMBER(BOOST_PP_TUPLE_ELEM(2, 0, xy))))
0082 #
0083 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
0084 #    define BOOST_PP_ADD_O(d, xy) BOOST_PP_ADD_O_I xy
0085 # else
0086 #    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))
0087 # endif
0088 #
0089 # define BOOST_PP_ADD_O_I(x, y) (BOOST_PP_INC(x), BOOST_PP_DEC(y))
0090 #
0091 # /* BOOST_PP_ADD_D */
0092 #
0093 #    define BOOST_PP_ADD_D(d, x, y) BOOST_PP_IIF(BOOST_PP_BITOR(BOOST_PP_DETAIL_IS_MAXIMUM_NUMBER(y),BOOST_PP_DETAIL_IS_MINIMUM_NUMBER(x)),BOOST_PP_IDENTITY_N(y,3),BOOST_PP_ADD_DO_D)(d,x,y)
0094 #
0095 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
0096 #    define BOOST_PP_ADD_DO_D(d, x, y) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_ADD_P, BOOST_PP_ADD_O, (x, y)))
0097 # else
0098 #    define BOOST_PP_ADD_DO_D(d, x, y) BOOST_PP_ADD_D_I(d, x, y)
0099 #    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)))
0100 # endif
0101 #
0102 # endif
0103 #
0104 # endif