Use detail check for number 1 rather than empty implementation.

This commit is contained in:
Edward Diener
2020-06-10 10:44:35 -04:00
parent 25aaea0136
commit e8bbb16f57
4 changed files with 20 additions and 17 deletions

View File

@ -18,12 +18,12 @@
# include <boost/preprocessor/config/config.hpp>
# include <boost/preprocessor/control/iif.hpp>
# include <boost/preprocessor/facilities/identity.hpp>
# include <boost/preprocessor/facilities/is_1.hpp>
# include <boost/preprocessor/tuple/elem.hpp>
# include <boost/preprocessor/arithmetic/detail/is_1_number.hpp>
#
# /* BOOST_PP_DIV */
#
# define BOOST_PP_DIV(x, y) BOOST_PP_IIF(BOOST_PP_IS_1(y),BOOST_PP_IDENTITY_N(x,2),BOOST_PP_DIV_DO)(x,y)
# define BOOST_PP_DIV(x, y) BOOST_PP_IIF(BOOST_PP_DETAIL_IS_1_NUMBER(y),BOOST_PP_IDENTITY_N(x,2),BOOST_PP_DIV_DO)(x,y)
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_DIV_DO(x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_DIV_BASE(x, y))
@ -34,7 +34,7 @@
#
# /* BOOST_PP_DIV_D */
#
# define BOOST_PP_DIV_D(d, x, y) BOOST_PP_IIF(BOOST_PP_IS_1(y),BOOST_PP_IDENTITY_N(x,3),BOOST_PP_DIV_DO_D)(d,x,y)
# define BOOST_PP_DIV_D(d, x, y) BOOST_PP_IIF(BOOST_PP_DETAIL_IS_1_NUMBER(y),BOOST_PP_IDENTITY_N(x,3),BOOST_PP_DIV_DO_D)(d,x,y)
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_DIV_DO_D(d, x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_DIV_BASE_D(d, x, y))

View File

@ -18,12 +18,12 @@
# include <boost/preprocessor/config/config.hpp>
# include <boost/preprocessor/control/iif.hpp>
# include <boost/preprocessor/facilities/identity.hpp>
# include <boost/preprocessor/facilities/is_1.hpp>
# include <boost/preprocessor/tuple/elem.hpp>
# include <boost/preprocessor/arithmetic/detail/is_1_number.hpp>
#
# /* BOOST_PP_MOD */
#
# define BOOST_PP_MOD(x, y) BOOST_PP_IIF(BOOST_PP_IS_1(y),BOOST_PP_IDENTITY_N(0,2),BOOST_PP_MOD_DO)(x,y)
# define BOOST_PP_MOD(x, y) BOOST_PP_IIF(BOOST_PP_DETAIL_IS_1_NUMBER(y),BOOST_PP_IDENTITY_N(0,2),BOOST_PP_MOD_DO)(x,y)
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_MOD_DO(x, y) BOOST_PP_TUPLE_ELEM(3, 1, BOOST_PP_DIV_BASE(x, y))
@ -34,7 +34,7 @@
#
# /* BOOST_PP_MOD_D */
#
# define BOOST_PP_MOD_D(d, x, y) BOOST_PP_IIF(BOOST_PP_IS_1(y),BOOST_PP_IDENTITY_N(0,3),BOOST_PP_MOD_DO_D)(d,x,y)
# define BOOST_PP_MOD_D(d, x, y) BOOST_PP_IIF(BOOST_PP_DETAIL_IS_1_NUMBER(y),BOOST_PP_IDENTITY_N(0,3),BOOST_PP_MOD_DO_D)(d,x,y)
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_MOD_DO_D(d, x, y) BOOST_PP_TUPLE_ELEM(3, 1, BOOST_PP_DIV_BASE_D(d, x, y))

View File

@ -20,7 +20,6 @@
# include <boost/preprocessor/control/iif.hpp>
# include <boost/preprocessor/control/while.hpp>
# include <boost/preprocessor/facilities/identity.hpp>
# include <boost/preprocessor/facilities/is_1.hpp>
# include <boost/preprocessor/logical/bitand.hpp>
# include <boost/preprocessor/logical/bitor.hpp>
# include <boost/preprocessor/logical/bool.hpp>
@ -29,15 +28,16 @@
# include <boost/preprocessor/tuple/rem.hpp>
# include <boost/preprocessor/arithmetic/detail/is_minimum_number.hpp>
# include <boost/preprocessor/arithmetic/detail/is_maximum_number.hpp>
# include <boost/preprocessor/arithmetic/detail/is_1_number.hpp>
#
# /* BOOST_PP_MUL */
#
# define BOOST_PP_MUL(x, y) \
BOOST_PP_IIF(BOOST_PP_BITOR(BOOST_PP_DETAIL_IS_MINIMUM_NUMBER(x),BOOST_PP_DETAIL_IS_MINIMUM_NUMBER(y)),BOOST_PP_IDENTITY_N(0,2),BOOST_PP_MUL_CHECK_1X)(x,y)
#
# define BOOST_PP_MUL_CHECK_1X(x, y) BOOST_PP_IIF(BOOST_PP_IS_1(x),BOOST_PP_IDENTITY_N(y,2),BOOST_PP_MUL_CHECK_1Y)(x,y)
# define BOOST_PP_MUL_CHECK_1X(x, y) BOOST_PP_IIF(BOOST_PP_DETAIL_IS_1_NUMBER(x),BOOST_PP_IDENTITY_N(y,2),BOOST_PP_MUL_CHECK_1Y)(x,y)
#
# define BOOST_PP_MUL_CHECK_1Y(x, y) BOOST_PP_IIF(BOOST_PP_IS_1(y),BOOST_PP_IDENTITY_N(x,2),BOOST_PP_MUL_DO)(x,y)
# define BOOST_PP_MUL_CHECK_1Y(x, y) BOOST_PP_IIF(BOOST_PP_DETAIL_IS_1_NUMBER(y),BOOST_PP_IDENTITY_N(x,2),BOOST_PP_MUL_DO)(x,y)
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_MUL_DO(x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
@ -62,9 +62,9 @@
# define BOOST_PP_MUL_D(d, x, y) \
BOOST_PP_IIF(BOOST_PP_BITOR(BOOST_PP_DETAIL_IS_MINIMUM_NUMBER(x),BOOST_PP_DETAIL_IS_MINIMUM_NUMBER(y)),BOOST_PP_IDENTITY_N(0,3),BOOST_PP_MUL_CHECK_1X_D)(d,x,y)
#
# define BOOST_PP_MUL_CHECK_1X_D(d, x, y) BOOST_PP_IIF(BOOST_PP_IS_1(x),BOOST_PP_IDENTITY_N(y,3),BOOST_PP_MUL_CHECK_1Y)(d,x,y)
# define BOOST_PP_MUL_CHECK_1X_D(d, x, y) BOOST_PP_IIF(BOOST_PP_DETAIL_IS_1_NUMBER(x),BOOST_PP_IDENTITY_N(y,3),BOOST_PP_MUL_CHECK_1Y)(d,x,y)
#
# define BOOST_PP_MUL_CHECK_1Y_D(d, x, y) BOOST_PP_IIF(BOOST_PP_IS_1(y),BOOST_PP_IDENTITY_N(x,3),BOOST_PP_MUL_DO_D)(d,x,y)
# define BOOST_PP_MUL_CHECK_1Y_D(d, x, y) BOOST_PP_IIF(BOOST_PP_DETAIL_IS_1_NUMBER(y),BOOST_PP_IDENTITY_N(x,3),BOOST_PP_MUL_DO_D)(d,x,y)
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_MUL_DO_D(d, x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))