Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:43:28

0001 // Copyright Cromwell D. Enage 2017.
0002 // Distributed under the Boost Software License, Version 1.0.
0003 // (See accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_BINARY_SEQ_TO_ARGS_HPP
0007 #define BOOST_PARAMETER_AUX_PREPROCESSOR_BINARY_SEQ_TO_ARGS_HPP
0008 
0009 #include <boost/preprocessor/seq/elem.hpp>
0010 #include <boost/preprocessor/cat.hpp>
0011 
0012 #define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_1(n, prefix_seq)          \
0013     BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, prefix_seq), n) const&
0014 /**/
0015 
0016 #define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_1(n, prefix_seq)          \
0017     BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, prefix_seq), n)&
0018 /**/
0019 
0020 #define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_2(n, prefix_seq)          \
0021     BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_1(n, prefix_seq)              \
0022     BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, prefix_seq), n)
0023 /**/
0024 
0025 #define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_2(n, prefix_seq)          \
0026     BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_1(n, prefix_seq)              \
0027     BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, prefix_seq), n)
0028 /**/
0029 
0030 #include <boost/preprocessor/seq/size.hpp>
0031 
0032 #define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0(prefix_seq)               \
0033     BOOST_PP_CAT(                                                            \
0034         BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_                          \
0035       , BOOST_PP_SEQ_SIZE(prefix_seq)                                        \
0036     )
0037 /**/
0038 
0039 #define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1(prefix_seq)               \
0040     BOOST_PP_CAT(                                                            \
0041         BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_                          \
0042       , BOOST_PP_SEQ_SIZE(prefix_seq)                                        \
0043     )
0044 /**/
0045 
0046 #include <boost/parameter/aux_/preprocessor/convert_binary_seq.hpp>
0047 
0048 // This macro converts the specified Boost.Preprocessor sequence of 1s and 0s
0049 // into a formal function parameter list.
0050 //
0051 // Example:
0052 // BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS((1)(0)(1)(0), (P)(p))
0053 // expands to
0054 // P0 & p0, P1 const& p1, P2 & p2, P3 const& p3
0055 #define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS(binary_seq, prefix_seq)    \
0056     BOOST_PARAMETER_AUX_PP_CONVERT_BINARY_SEQ(                               \
0057         binary_seq                                                           \
0058       , BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0(prefix_seq)               \
0059       , BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1(prefix_seq)               \
0060       , prefix_seq                                                           \
0061     )
0062 /**/
0063 
0064 #endif  // include guard
0065