File indexing completed on 2025-01-18 09:43:28
0001
0002
0003
0004
0005
0006 #ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_INC_BINARY_SEQ_HPP
0007 #define BOOST_PARAMETER_AUX_PREPROCESSOR_INC_BINARY_SEQ_HPP
0008
0009 #include <boost/preprocessor/seq/push_back.hpp>
0010
0011
0012 #define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_0(seq, element) \
0013 (BOOST_PP_SEQ_PUSH_BACK(seq, element), 0)
0014
0015
0016 #include <boost/preprocessor/control/iif.hpp>
0017
0018
0019 #define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_1(seq, element) \
0020 (BOOST_PP_SEQ_PUSH_BACK(seq, BOOST_PP_IIF(element, 0, 1)), element)
0021
0022
0023 #include <boost/preprocessor/tuple/elem.hpp>
0024 #include <boost/preprocessor/cat.hpp>
0025
0026
0027
0028 #define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_OP(s, result_tuple, element) \
0029 BOOST_PP_CAT( \
0030 BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_ \
0031 , BOOST_PP_TUPLE_ELEM(2, 1, result_tuple) \
0032 )(BOOST_PP_TUPLE_ELEM(2, 0, result_tuple), element)
0033
0034
0035
0036 #define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL_0(seq) seq
0037
0038
0039
0040 #define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL_1(seq) \
0041 BOOST_PP_SEQ_PUSH_BACK(seq, 0)
0042
0043
0044
0045
0046
0047
0048 #define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL(seq_and_carry) \
0049 BOOST_PP_CAT( \
0050 BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL_ \
0051 , BOOST_PP_TUPLE_ELEM(2, 1, seq_and_carry) \
0052 )(BOOST_PP_TUPLE_ELEM(2, 0, seq_and_carry))
0053
0054
0055 #include <boost/preprocessor/seq/seq.hpp>
0056 #include <boost/preprocessor/seq/fold_left.hpp>
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067 #define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ(seq) \
0068 BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL( \
0069 BOOST_PP_SEQ_FOLD_LEFT( \
0070 BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_OP \
0071 , (BOOST_PP_SEQ_NIL, 1) \
0072 , seq \
0073 ) \
0074 )
0075
0076
0077 #endif
0078