123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707 |
- // (C) Copyright Edward Diener 2011-2015
- // Use, modification and distribution are subject to the Boost Software License,
- // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- // http://www.boost.org/LICENSE_1_0.txt).
- #if !defined(BOOST_VMD_DETAIL_MODS_HPP)
- #define BOOST_VMD_DETAIL_MODS_HPP
- #include <boost/preprocessor/arithmetic/inc.hpp>
- #include <boost/preprocessor/comparison/equal.hpp>
- #include <boost/preprocessor/comparison/greater.hpp>
- #include <boost/preprocessor/control/iif.hpp>
- #include <boost/preprocessor/control/while.hpp>
- #include <boost/preprocessor/punctuation/is_begin_parens.hpp>
- #include <boost/preprocessor/tuple/elem.hpp>
- #include <boost/preprocessor/tuple/pop_front.hpp>
- #include <boost/preprocessor/tuple/push_back.hpp>
- #include <boost/preprocessor/tuple/replace.hpp>
- #include <boost/preprocessor/tuple/size.hpp>
- #include <boost/preprocessor/variadic/to_tuple.hpp>
- #include <boost/vmd/identity.hpp>
- #include <boost/vmd/is_empty.hpp>
- #include <boost/vmd/is_type.hpp>
- #include <boost/vmd/detail/modifiers.hpp>
- #define BOOST_VMD_DETAIL_MODS_NO_RETURN 0
- #define BOOST_VMD_DETAIL_MODS_RETURN 1
- #define BOOST_VMD_DETAIL_MODS_RETURN_TUPLE 2
- #define BOOST_VMD_DETAIL_MODS_RETURN_ARRAY 3
- #define BOOST_VMD_DETAIL_MODS_RETURN_LIST 4
- #define BOOST_VMD_DETAIL_MODS_NO_AFTER 0
- #define BOOST_VMD_DETAIL_MODS_RETURN_AFTER 1
- #define BOOST_VMD_DETAIL_MODS_NO_INDEX 0
- #define BOOST_VMD_DETAIL_MODS_RETURN_INDEX 1
- #define BOOST_VMD_DETAIL_MODS_NO_ONLY_AFTER 0
- #define BOOST_VMD_DETAIL_MODS_RETURN_ONLY_AFTER 1
- #define BOOST_VMD_DETAIL_MODS_TUPLE_RETURN 0
- #define BOOST_VMD_DETAIL_MODS_TUPLE_AFTER 1
- #define BOOST_VMD_DETAIL_MODS_TUPLE_INDEX 2
- #define BOOST_VMD_DETAIL_MODS_TUPLE_OTHER 3
- #define BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER 4
- #define BOOST_VMD_DETAIL_MODS_TUPLE_TYPE 5
- #define BOOST_VMD_DETAIL_MODS_DATA_INPUT 0
- #define BOOST_VMD_DETAIL_MODS_DATA_INDEX 1
- #define BOOST_VMD_DETAIL_MODS_DATA_SIZE 2
- #define BOOST_VMD_DETAIL_MODS_DATA_RESULT 3
- #define BOOST_VMD_DETAIL_MODS_DATA_ALLOW 4
- #define BOOST_VMD_DETAIL_MODS_STATE_INPUT(state) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_INPUT,state) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_STATE_INDEX(state) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_INDEX,state) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_STATE_SIZE(state) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_SIZE,state) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_STATE_RESULT(state) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_RESULT,state) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_ALLOW,state) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_ALL(state) \
- BOOST_VMD_DETAIL_IS_ALLOW_ALL(BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state)) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_RETURN(state) \
- BOOST_VMD_DETAIL_IS_ALLOW_RETURN(BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state)) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_AFTER(state) \
- BOOST_VMD_DETAIL_IS_ALLOW_AFTER(BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state)) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_INDEX(state) \
- BOOST_VMD_DETAIL_IS_ALLOW_INDEX(BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state)) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_STATE_CURRENT(state) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_STATE_INDEX(state),BOOST_VMD_DETAIL_MODS_STATE_INPUT(state)) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_STATE_TYPE(state) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_RETURN,BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_STATE_AFTER(state) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_AFTER,BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_STATE_ONLY_AFTER(state) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER,BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_STATE_TINDEX(state) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_INDEX,BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_RESULT_RETURN_TYPE(result) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_RETURN,result) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER(result) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_AFTER,result) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_IS_RESULT_ONLY_AFTER(result) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER,result) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_IS_RESULT_INDEX(result) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_INDEX,result) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_RESULT_OTHER(result) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_OTHER,result) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_RESULT_TYPE(result) \
- BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_TYPE,result) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_PRED(d,state) \
- BOOST_PP_GREATER_D(d,BOOST_VMD_DETAIL_MODS_STATE_SIZE(state),BOOST_VMD_DETAIL_MODS_STATE_INDEX(state))
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,number) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
- ( \
- d, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- state, \
- BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
- BOOST_VMD_DETAIL_MODS_TUPLE_RETURN, \
- number \
- ) \
- ) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ONLY_AFTER(d,state,id) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
- ( \
- d, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- state, \
- BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
- BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER, \
- 1 \
- ), \
- BOOST_VMD_DETAIL_MODS_TUPLE_AFTER, \
- 1 \
- ) \
- ) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_INDEX(d,state,number) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
- ( \
- d, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- state, \
- BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
- BOOST_VMD_DETAIL_MODS_TUPLE_INDEX, \
- number \
- ) \
- ) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_GTT(d,state,id) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_RETURN_TUPLE) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ET(d,state,id) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_RETURN) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_SA(d,state,id) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_RETURN_ARRAY) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_SL(d,state,id) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_RETURN_LIST) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_NT(d,state,id) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_NO_RETURN) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_AFT(d,state,id) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
- ( \
- d, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- state, \
- BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
- BOOST_VMD_DETAIL_MODS_TUPLE_AFTER, \
- BOOST_VMD_DETAIL_MODS_RETURN_AFTER \
- ) \
- ) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_NOAFT(d,state,id) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
- ( \
- d, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- state, \
- BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
- BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER, \
- 0 \
- ), \
- BOOST_VMD_DETAIL_MODS_TUPLE_AFTER, \
- BOOST_VMD_DETAIL_MODS_NO_AFTER \
- ) \
- ) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_IND(d,state,id) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_INDEX(d,state,BOOST_VMD_DETAIL_MODS_RETURN_INDEX) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_NO_IND(d,state,id) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_INDEX(d,state,BOOST_VMD_DETAIL_MODS_NO_INDEX) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE_REPLACE(d,state,id) \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
- BOOST_VMD_DETAIL_MODS_TUPLE_OTHER, \
- BOOST_PP_VARIADIC_TO_TUPLE(id) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE_ADD(d,state,id) \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
- BOOST_VMD_DETAIL_MODS_TUPLE_OTHER, \
- BOOST_PP_TUPLE_PUSH_BACK \
- ( \
- BOOST_VMD_DETAIL_MODS_RESULT_OTHER(BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)), \
- id \
- ) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE(d,state,id) \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_IS_EMPTY \
- ( \
- BOOST_VMD_DETAIL_MODS_RESULT_OTHER(BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \
- ), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE_REPLACE, \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE_ADD \
- ) \
- (d,state,id) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_TYPE_RETURN(d,state,id) \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
- BOOST_VMD_DETAIL_MODS_TUPLE_RETURN, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,id,BOOST_VMD_TYPE_ARRAY), \
- BOOST_VMD_DETAIL_MODS_RETURN_ARRAY, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,id,BOOST_VMD_TYPE_LIST), \
- BOOST_VMD_DETAIL_MODS_RETURN_LIST, \
- BOOST_VMD_DETAIL_MODS_RETURN_TUPLE \
- ) \
- ) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_TYPE(d,state,id) \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_TYPE_RETURN(d,state,id), \
- BOOST_VMD_DETAIL_MODS_TUPLE_TYPE, \
- id \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN(d,state,id) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
- ( \
- d, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- state, \
- BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
- BOOST_PP_IIF \
- ( \
- BOOST_PP_BITAND \
- ( \
- BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_ALL(state), \
- BOOST_VMD_IS_TYPE_D(d,id) \
- ), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_TYPE, \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE \
- ) \
- (d,state,id) \
- ) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE(d,state) \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- state, \
- BOOST_VMD_DETAIL_MODS_DATA_INDEX, \
- BOOST_PP_INC(BOOST_VMD_DETAIL_MODS_STATE_INDEX(state)) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_ALL(d,state,id) \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_TYPE_TUPLE(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_GTT, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_TYPE(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_ET, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_TYPE_ARRAY(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_SA, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_TYPE_LIST(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_SL, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_NO_TYPE(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_NT, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_AFTER(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_AFT, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_NO_AFTER(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_NOAFT, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_ONLY_AFTER(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_ONLY_AFTER, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_INDEX(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_IND, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_NO_INDEX(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_NO_IND, \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN \
- ) \
- ) \
- ) \
- ) \
- ) \
- ) \
- ) \
- ) \
- ) \
- ) \
- (d,state,id) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_RETURN(d,state,id) \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_TYPE_TUPLE(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_GTT, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_TYPE(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_ET, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_TYPE_ARRAY(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_SA, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_TYPE_LIST(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_SL, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_NO_TYPE(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_NT, \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN \
- ) \
- ) \
- ) \
- ) \
- ) \
- (d,state,id) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_AFTER(d,state,id) \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_AFTER(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_AFT, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_NO_AFTER(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_NOAFT, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_ONLY_AFTER(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_ONLY_AFTER, \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN \
- ) \
- ) \
- ) \
- (d,state,id) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_INDEX(d,state,id) \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_AFTER(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_AFT, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_NO_AFTER(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_NOAFT, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_ONLY_AFTER(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_ONLY_AFTER, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_INDEX(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_IND, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_IS_RETURN_NO_INDEX(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_NO_IND, \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN \
- ) \
- ) \
- ) \
- ) \
- ) \
- (d,state,id) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_UPDATE(d,state,id) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE(d,state) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ID(d,state,id) \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_ALL(state), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_ALL, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_RETURN(state), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_RETURN, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_AFTER(state), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_AFTER, \
- BOOST_PP_IIF \
- ( \
- BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_INDEX(state), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_INDEX, \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_UPDATE \
- ) \
- ) \
- ) \
- ) \
- (d,state,id) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_TUPLE(d,state,id) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
- ( \
- d, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- state, \
- BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
- BOOST_PP_TUPLE_REPLACE_D \
- ( \
- d, \
- BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
- BOOST_VMD_DETAIL_MODS_TUPLE_OTHER, \
- id \
- ) \
- ) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP_CURRENT(d,state,id) \
- BOOST_PP_IIF \
- ( \
- BOOST_PP_IS_BEGIN_PARENS(id), \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_TUPLE, \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT_ID \
- ) \
- (d,state,id) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_OP(d,state) \
- BOOST_VMD_DETAIL_MODS_OP_CURRENT(d,state,BOOST_VMD_DETAIL_MODS_STATE_CURRENT(state)) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_LOOP(allow,tuple) \
- BOOST_PP_TUPLE_ELEM \
- ( \
- 3, \
- BOOST_PP_WHILE \
- ( \
- BOOST_VMD_DETAIL_MODS_PRED, \
- BOOST_VMD_DETAIL_MODS_OP, \
- ( \
- tuple, \
- 0, \
- BOOST_PP_TUPLE_SIZE(tuple), \
- (0,0,0,,0,), \
- allow \
- ) \
- ) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_MODS_LOOP_D(d,allow,tuple) \
- BOOST_PP_TUPLE_ELEM \
- ( \
- 3, \
- BOOST_PP_WHILE_ ## d \
- ( \
- BOOST_VMD_DETAIL_MODS_PRED, \
- BOOST_VMD_DETAIL_MODS_OP, \
- ( \
- tuple, \
- 0, \
- BOOST_PP_TUPLE_SIZE(tuple), \
- (0,0,0,,0,), \
- allow \
- ) \
- ) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_NEW_MODS_VAR(allow,tuple) \
- BOOST_VMD_DETAIL_MODS_LOOP \
- ( \
- allow, \
- BOOST_PP_TUPLE_POP_FRONT(tuple) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_NEW_MODS_VAR_D(d,allow,tuple) \
- BOOST_VMD_DETAIL_MODS_LOOP_D \
- ( \
- d, \
- allow, \
- BOOST_PP_TUPLE_POP_FRONT(tuple) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_NEW_MODS_IR(allow,tuple) \
- BOOST_VMD_IDENTITY_RESULT \
- ( \
- BOOST_PP_IIF \
- ( \
- BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(tuple),1), \
- BOOST_VMD_IDENTITY((0,0,0,,0,)), \
- BOOST_VMD_DETAIL_NEW_MODS_VAR \
- ) \
- (allow,tuple) \
- ) \
- /**/
- #define BOOST_VMD_DETAIL_NEW_MODS_IR_D(d,allow,tuple) \
- BOOST_VMD_IDENTITY_RESULT \
- ( \
- BOOST_PP_IIF \
- ( \
- BOOST_PP_EQUAL_D(d,BOOST_PP_TUPLE_SIZE(tuple),1), \
- BOOST_VMD_IDENTITY((0,0,0,,0,)), \
- BOOST_VMD_DETAIL_NEW_MODS_VAR_D \
- ) \
- (d,allow,tuple) \
- ) \
- /**/
- /*
- Returns a six-element tuple:
-
- First tuple element = 0 No type return
- 1 Exact type return
- 2 General tuple type return
- 3 Array return
- 4 List return
-
- Second tuple element = 0 No after return
- 1 After return
-
- Third tuple element = 0 No identifier index
- 1 Identifier Index
-
- Fourth tuple element = Tuple of other identifiers
-
- Fifth tuple element = 0 No after only return
- 1 After only return
-
- Sixth tuple element = Type identifier
-
- Input = allow, either
- BOOST_VMD_ALLOW_ALL
- BOOST_VMD_ALLOW_RETURN
- BOOST_VMD_ALLOW_AFTER
- BOOST_VMD_ALLOW_INDEX
-
- ..., modifiers, first variadic is discarded
- Possible modifiers are:
-
- BOOST_VMD_RETURN_NO_TYPE = (0,0)
- BOOST_VMD_RETURN_TYPE = (1,0)
- BOOST_VMD_RETURN_TYPE_TUPLE = (2,0)
- BOOST_VMD_RETURN_TYPE_ARRAY = (3,0)
- BOOST_VMD_RETURN_TYPE_LIST = (4,0)
-
- BOOST_VMD_RETURN_NO_AFTER = (0,0)
- BOOST_VMD_RETURN_AFTER = (0,1)
-
- */
- #define BOOST_VMD_DETAIL_NEW_MODS(allow,...) \
- BOOST_VMD_DETAIL_NEW_MODS_IR(allow,BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__)) \
- /**/
- #define BOOST_VMD_DETAIL_NEW_MODS_D(d,allow,...) \
- BOOST_VMD_DETAIL_NEW_MODS_IR_D(d,allow,BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__)) \
- /**/
- #endif /* BOOST_VMD_DETAIL_MODS_HPP */
|