Add extra iteration for fold_left and fold_right to cover maximum operations.

This commit is contained in:
Edward Diener
2020-07-07 19:13:05 -04:00
parent db21240060
commit 0fd6b84304
12 changed files with 35 additions and 12 deletions

View File

@ -14,6 +14,7 @@
# ifndef BOOST_PREPROCESSOR_SEQ_FOLD_RIGHT_HPP
# define BOOST_PREPROCESSOR_SEQ_FOLD_RIGHT_HPP
#
# include <boost/preprocessor/arithmetic/dec.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/detail/auto_rec.hpp>
# include <boost/preprocessor/seq/fold_left.hpp>
@ -29,10 +30,10 @@
# include <boost/preprocessor/config/limits.hpp>
#
# if BOOST_PP_LIMIT_SEQ == 256
# define BOOST_PP_SEQ_FOLD_RIGHT BOOST_PP_CAT(BOOST_PP_SEQ_FOLD_RIGHT_, BOOST_PP_AUTO_REC(BOOST_PP_SEQ_FOLD_LEFT_P, 256))
# define BOOST_PP_SEQ_FOLD_RIGHT BOOST_PP_CAT(BOOST_PP_SEQ_FOLD_RIGHT_, BOOST_PP_DEC(BOOST_PP_AUTO_REC(BOOST_PP_SEQ_FOLD_LEFT_P, 256)))
# define BOOST_PP_SEQ_FOLD_RIGHT_257(op, st, ss) BOOST_PP_ERROR(0x0005)
# elif BOOST_PP_LIMIT_SEQ == 512
# define BOOST_PP_SEQ_FOLD_RIGHT BOOST_PP_CAT(BOOST_PP_SEQ_FOLD_RIGHT_, BOOST_PP_AUTO_REC(BOOST_PP_SEQ_FOLD_LEFT_P, 512))
# define BOOST_PP_SEQ_FOLD_RIGHT BOOST_PP_CAT(BOOST_PP_SEQ_FOLD_RIGHT_, BOOST_PP_DEC(BOOST_PP_AUTO_REC(BOOST_PP_SEQ_FOLD_LEFT_P, 512)))
# define BOOST_PP_SEQ_FOLD_RIGHT_513(op, st, ss) BOOST_PP_ERROR(0x0005)
# else
# error Incorrect value for the BOOST_PP_LIMIT_SEQ limit