Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:36

0001 
0002 //  (C) Copyright Edward Diener 2011-2015
0003 //  Use, modification and distribution are subject to the Boost Software License,
0004 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 //  http://www.boost.org/LICENSE_1_0.txt).
0006 
0007 #if !defined(BOOST_VMD_DETAIL_MODS_HPP)
0008 #define BOOST_VMD_DETAIL_MODS_HPP
0009 
0010 #include <boost/preprocessor/arithmetic/inc.hpp>
0011 #include <boost/preprocessor/comparison/equal.hpp>
0012 #include <boost/preprocessor/comparison/greater.hpp>
0013 #include <boost/preprocessor/control/iif.hpp>
0014 #include <boost/preprocessor/control/while.hpp>
0015 #include <boost/preprocessor/punctuation/is_begin_parens.hpp>
0016 #include <boost/preprocessor/tuple/elem.hpp>
0017 #include <boost/preprocessor/tuple/pop_front.hpp>
0018 #include <boost/preprocessor/tuple/push_back.hpp>
0019 #include <boost/preprocessor/tuple/replace.hpp>
0020 #include <boost/preprocessor/tuple/size.hpp>
0021 #include <boost/preprocessor/variadic/to_tuple.hpp>
0022 #include <boost/vmd/identity.hpp>
0023 #include <boost/vmd/is_empty.hpp>
0024 #include <boost/vmd/is_type.hpp>
0025 #include <boost/vmd/detail/modifiers.hpp>
0026 
0027 #define BOOST_VMD_DETAIL_MODS_NO_RETURN 0
0028 #define BOOST_VMD_DETAIL_MODS_RETURN 1
0029 #define BOOST_VMD_DETAIL_MODS_RETURN_TUPLE 2
0030 #define BOOST_VMD_DETAIL_MODS_RETURN_ARRAY 3
0031 #define BOOST_VMD_DETAIL_MODS_RETURN_LIST 4
0032 #define BOOST_VMD_DETAIL_MODS_NO_AFTER 0
0033 #define BOOST_VMD_DETAIL_MODS_RETURN_AFTER 1
0034 #define BOOST_VMD_DETAIL_MODS_NO_INDEX 0
0035 #define BOOST_VMD_DETAIL_MODS_RETURN_INDEX 1
0036 #define BOOST_VMD_DETAIL_MODS_NO_ONLY_AFTER 0
0037 #define BOOST_VMD_DETAIL_MODS_RETURN_ONLY_AFTER 1
0038 
0039 #define BOOST_VMD_DETAIL_MODS_TUPLE_RETURN 0
0040 #define BOOST_VMD_DETAIL_MODS_TUPLE_AFTER 1
0041 #define BOOST_VMD_DETAIL_MODS_TUPLE_INDEX 2
0042 #define BOOST_VMD_DETAIL_MODS_TUPLE_OTHER 3
0043 #define BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER 4
0044 #define BOOST_VMD_DETAIL_MODS_TUPLE_TYPE 5
0045 
0046 #define BOOST_VMD_DETAIL_MODS_DATA_INPUT 0
0047 #define BOOST_VMD_DETAIL_MODS_DATA_INDEX 1
0048 #define BOOST_VMD_DETAIL_MODS_DATA_SIZE 2
0049 #define BOOST_VMD_DETAIL_MODS_DATA_RESULT 3
0050 #define BOOST_VMD_DETAIL_MODS_DATA_ALLOW 4
0051 
0052 #define BOOST_VMD_DETAIL_MODS_STATE_INPUT(state) \
0053     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_INPUT,state) \
0054 /**/
0055 
0056 #define BOOST_VMD_DETAIL_MODS_STATE_INDEX(state) \
0057     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_INDEX,state) \
0058 /**/
0059 
0060 #define BOOST_VMD_DETAIL_MODS_STATE_SIZE(state) \
0061     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_SIZE,state) \
0062 /**/
0063 
0064 #define BOOST_VMD_DETAIL_MODS_STATE_RESULT(state) \
0065     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_RESULT,state) \
0066 /**/
0067 
0068 #define BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state) \
0069     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_DATA_ALLOW,state) \
0070 /**/
0071 
0072 #define BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_ALL(state) \
0073     BOOST_VMD_DETAIL_IS_ALLOW_ALL(BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state)) \
0074 /**/
0075 
0076 #define BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_RETURN(state) \
0077     BOOST_VMD_DETAIL_IS_ALLOW_RETURN(BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state)) \
0078 /**/
0079 
0080 #define BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_AFTER(state) \
0081     BOOST_VMD_DETAIL_IS_ALLOW_AFTER(BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state)) \
0082 /**/
0083 
0084 #define BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_INDEX(state) \
0085     BOOST_VMD_DETAIL_IS_ALLOW_INDEX(BOOST_VMD_DETAIL_MODS_STATE_ALLOW(state)) \
0086 /**/
0087 
0088 #define BOOST_VMD_DETAIL_MODS_STATE_CURRENT(state) \
0089     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_STATE_INDEX(state),BOOST_VMD_DETAIL_MODS_STATE_INPUT(state)) \
0090 /**/
0091 
0092 #define BOOST_VMD_DETAIL_MODS_STATE_TYPE(state) \
0093     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_RETURN,BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \
0094 /**/
0095 
0096 #define BOOST_VMD_DETAIL_MODS_STATE_AFTER(state) \
0097     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_AFTER,BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \
0098 /**/
0099 
0100 #define BOOST_VMD_DETAIL_MODS_STATE_ONLY_AFTER(state) \
0101     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER,BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \
0102 /**/
0103 
0104 #define BOOST_VMD_DETAIL_MODS_STATE_TINDEX(state) \
0105     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_INDEX,BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \
0106 /**/
0107 
0108 #define BOOST_VMD_DETAIL_MODS_RESULT_RETURN_TYPE(result) \
0109     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_RETURN,result) \
0110 /**/
0111 
0112 #define BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER(result) \
0113     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_AFTER,result) \
0114 /**/
0115 
0116 #define BOOST_VMD_DETAIL_MODS_IS_RESULT_ONLY_AFTER(result) \
0117     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER,result) \
0118 /**/
0119 
0120 #define BOOST_VMD_DETAIL_MODS_IS_RESULT_INDEX(result) \
0121     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_INDEX,result) \
0122 /**/
0123 
0124 #define BOOST_VMD_DETAIL_MODS_RESULT_OTHER(result) \
0125     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_OTHER,result) \
0126 /**/
0127 
0128 #define BOOST_VMD_DETAIL_MODS_RESULT_TYPE(result) \
0129     BOOST_PP_TUPLE_ELEM(BOOST_VMD_DETAIL_MODS_TUPLE_TYPE,result) \
0130 /**/
0131 
0132 #define BOOST_VMD_DETAIL_MODS_PRED(d,state) \
0133     BOOST_PP_GREATER_D(d,BOOST_VMD_DETAIL_MODS_STATE_SIZE(state),BOOST_VMD_DETAIL_MODS_STATE_INDEX(state))
0134 /**/
0135 
0136 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,number) \
0137     BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
0138         ( \
0139         d, \
0140         BOOST_PP_TUPLE_REPLACE_D \
0141             ( \
0142             d, \
0143             state, \
0144             BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
0145             BOOST_PP_TUPLE_REPLACE_D \
0146                 ( \
0147                 d, \
0148                 BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
0149                 BOOST_VMD_DETAIL_MODS_TUPLE_RETURN, \
0150                 number \
0151                 ) \
0152             ) \
0153         ) \
0154 /**/
0155 
0156 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ONLY_AFTER(d,state,id) \
0157     BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
0158         ( \
0159         d, \
0160         BOOST_PP_TUPLE_REPLACE_D \
0161             ( \
0162             d, \
0163             state, \
0164             BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
0165             BOOST_PP_TUPLE_REPLACE_D \
0166                 ( \
0167                 d, \
0168                 BOOST_PP_TUPLE_REPLACE_D \
0169                     ( \
0170                     d, \
0171                     BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
0172                     BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER, \
0173                     1 \
0174                     ), \
0175                 BOOST_VMD_DETAIL_MODS_TUPLE_AFTER, \
0176                 1 \
0177                 ) \
0178             ) \
0179         ) \
0180 /**/
0181 
0182 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_INDEX(d,state,number) \
0183     BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
0184         ( \
0185         d, \
0186         BOOST_PP_TUPLE_REPLACE_D \
0187             ( \
0188             d, \
0189             state, \
0190             BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
0191             BOOST_PP_TUPLE_REPLACE_D \
0192                 ( \
0193                 d, \
0194                 BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
0195                 BOOST_VMD_DETAIL_MODS_TUPLE_INDEX, \
0196                 number \
0197                 ) \
0198             ) \
0199         ) \
0200 /**/
0201 
0202 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_GTT(d,state,id) \
0203     BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_RETURN_TUPLE) \
0204 /**/
0205 
0206 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ET(d,state,id) \
0207     BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_RETURN) \
0208 /**/
0209 
0210 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_SA(d,state,id) \
0211     BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_RETURN_ARRAY) \
0212 /**/
0213 
0214 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_SL(d,state,id) \
0215     BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_RETURN_LIST) \
0216 /**/
0217 
0218 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_NT(d,state,id) \
0219     BOOST_VMD_DETAIL_MODS_OP_CURRENT_RETURN_TYPE(d,state,BOOST_VMD_DETAIL_MODS_NO_RETURN) \
0220 /**/
0221 
0222 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_AFT(d,state,id) \
0223     BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
0224         ( \
0225         d, \
0226         BOOST_PP_TUPLE_REPLACE_D \
0227             ( \
0228             d, \
0229             state, \
0230             BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
0231             BOOST_PP_TUPLE_REPLACE_D \
0232                 ( \
0233                 d, \
0234                 BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
0235                 BOOST_VMD_DETAIL_MODS_TUPLE_AFTER, \
0236                 BOOST_VMD_DETAIL_MODS_RETURN_AFTER \
0237                 ) \
0238             ) \
0239         ) \
0240 /**/
0241 
0242 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_NOAFT(d,state,id) \
0243     BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
0244         ( \
0245         d, \
0246         BOOST_PP_TUPLE_REPLACE_D \
0247             ( \
0248             d, \
0249             state, \
0250             BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
0251             BOOST_PP_TUPLE_REPLACE_D \
0252                 ( \
0253                 d, \
0254                 BOOST_PP_TUPLE_REPLACE_D \
0255                     ( \
0256                     d, \
0257                     BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
0258                     BOOST_VMD_DETAIL_MODS_TUPLE_ONLY_AFTER, \
0259                     0 \
0260                     ), \
0261                 BOOST_VMD_DETAIL_MODS_TUPLE_AFTER, \
0262                 BOOST_VMD_DETAIL_MODS_NO_AFTER \
0263                 ) \
0264             ) \
0265         ) \
0266 /**/
0267 
0268 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_IND(d,state,id) \
0269     BOOST_VMD_DETAIL_MODS_OP_CURRENT_INDEX(d,state,BOOST_VMD_DETAIL_MODS_RETURN_INDEX) \
0270 /**/
0271 
0272 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_NO_IND(d,state,id) \
0273     BOOST_VMD_DETAIL_MODS_OP_CURRENT_INDEX(d,state,BOOST_VMD_DETAIL_MODS_NO_INDEX) \
0274 /**/
0275 
0276 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE_REPLACE(d,state,id) \
0277     BOOST_PP_TUPLE_REPLACE_D \
0278         ( \
0279         d, \
0280         BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
0281         BOOST_VMD_DETAIL_MODS_TUPLE_OTHER, \
0282         BOOST_PP_VARIADIC_TO_TUPLE(id) \
0283         ) \
0284 /**/
0285 
0286 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE_ADD(d,state,id) \
0287     BOOST_PP_TUPLE_REPLACE_D \
0288         ( \
0289         d, \
0290         BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
0291         BOOST_VMD_DETAIL_MODS_TUPLE_OTHER, \
0292         BOOST_PP_TUPLE_PUSH_BACK \
0293             ( \
0294             BOOST_VMD_DETAIL_MODS_RESULT_OTHER(BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)), \
0295             id \
0296             ) \
0297         ) \
0298 /**/
0299 
0300 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE(d,state,id) \
0301     BOOST_PP_IIF \
0302         ( \
0303         BOOST_VMD_IS_EMPTY \
0304             ( \
0305             BOOST_VMD_DETAIL_MODS_RESULT_OTHER(BOOST_VMD_DETAIL_MODS_STATE_RESULT(state)) \
0306             ), \
0307         BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE_REPLACE, \
0308         BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE_ADD \
0309         ) \
0310     (d,state,id) \
0311 /**/
0312 
0313 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_TYPE_RETURN(d,state,id) \
0314     BOOST_PP_TUPLE_REPLACE_D \
0315         ( \
0316         d, \
0317         BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
0318         BOOST_VMD_DETAIL_MODS_TUPLE_RETURN, \
0319         BOOST_PP_IIF \
0320             ( \
0321             BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,id,BOOST_VMD_TYPE_ARRAY), \
0322             BOOST_VMD_DETAIL_MODS_RETURN_ARRAY, \
0323             BOOST_PP_IIF \
0324                 ( \
0325                 BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,id,BOOST_VMD_TYPE_LIST), \
0326                 BOOST_VMD_DETAIL_MODS_RETURN_LIST, \
0327                 BOOST_VMD_DETAIL_MODS_RETURN_TUPLE \
0328                 ) \
0329             ) \
0330         ) \
0331 /**/
0332 
0333 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_TYPE(d,state,id) \
0334     BOOST_PP_TUPLE_REPLACE_D \
0335         ( \
0336         d, \
0337         BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_TYPE_RETURN(d,state,id), \
0338         BOOST_VMD_DETAIL_MODS_TUPLE_TYPE, \
0339         id \
0340         ) \
0341 /**/
0342 
0343 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN(d,state,id) \
0344     BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
0345         ( \
0346         d, \
0347         BOOST_PP_TUPLE_REPLACE_D \
0348             ( \
0349             d, \
0350             state, \
0351             BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
0352             BOOST_PP_IIF \
0353                 ( \
0354                 BOOST_PP_BITAND \
0355                     ( \
0356                     BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_ALL(state), \
0357                     BOOST_VMD_IS_TYPE_D(d,id) \
0358                     ), \
0359                 BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_TYPE, \
0360                 BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN_CTUPLE \
0361                 ) \
0362             (d,state,id) \
0363             ) \
0364         ) \
0365 /**/
0366 
0367 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE(d,state) \
0368     BOOST_PP_TUPLE_REPLACE_D \
0369         ( \
0370         d, \
0371         state, \
0372         BOOST_VMD_DETAIL_MODS_DATA_INDEX, \
0373         BOOST_PP_INC(BOOST_VMD_DETAIL_MODS_STATE_INDEX(state)) \
0374         ) \
0375 /**/
0376 
0377 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_ALL(d,state,id) \
0378     BOOST_PP_IIF \
0379         ( \
0380         BOOST_VMD_DETAIL_IS_RETURN_TYPE_TUPLE(id), \
0381         BOOST_VMD_DETAIL_MODS_OP_CURRENT_GTT, \
0382         BOOST_PP_IIF \
0383             ( \
0384             BOOST_VMD_DETAIL_IS_RETURN_TYPE(id), \
0385             BOOST_VMD_DETAIL_MODS_OP_CURRENT_ET, \
0386             BOOST_PP_IIF \
0387                 ( \
0388                 BOOST_VMD_DETAIL_IS_RETURN_TYPE_ARRAY(id), \
0389                 BOOST_VMD_DETAIL_MODS_OP_CURRENT_SA, \
0390                 BOOST_PP_IIF \
0391                     ( \
0392                     BOOST_VMD_DETAIL_IS_RETURN_TYPE_LIST(id), \
0393                     BOOST_VMD_DETAIL_MODS_OP_CURRENT_SL, \
0394                     BOOST_PP_IIF \
0395                         ( \
0396                         BOOST_VMD_DETAIL_IS_RETURN_NO_TYPE(id), \
0397                         BOOST_VMD_DETAIL_MODS_OP_CURRENT_NT, \
0398                         BOOST_PP_IIF \
0399                             ( \
0400                             BOOST_VMD_DETAIL_IS_RETURN_AFTER(id), \
0401                             BOOST_VMD_DETAIL_MODS_OP_CURRENT_AFT, \
0402                             BOOST_PP_IIF \
0403                                 ( \
0404                                 BOOST_VMD_DETAIL_IS_RETURN_NO_AFTER(id), \
0405                                 BOOST_VMD_DETAIL_MODS_OP_CURRENT_NOAFT, \
0406                                 BOOST_PP_IIF \
0407                                     ( \
0408                                     BOOST_VMD_DETAIL_IS_RETURN_ONLY_AFTER(id), \
0409                                     BOOST_VMD_DETAIL_MODS_OP_CURRENT_ONLY_AFTER, \
0410                                     BOOST_PP_IIF \
0411                                         ( \
0412                                         BOOST_VMD_DETAIL_IS_RETURN_INDEX(id), \
0413                                         BOOST_VMD_DETAIL_MODS_OP_CURRENT_IND, \
0414                                         BOOST_PP_IIF \
0415                                             ( \
0416                                             BOOST_VMD_DETAIL_IS_RETURN_NO_INDEX(id), \
0417                                             BOOST_VMD_DETAIL_MODS_OP_CURRENT_NO_IND, \
0418                                             BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN \
0419                                             ) \
0420                                         ) \
0421                                     ) \
0422                                 ) \
0423                             ) \
0424                         ) \
0425                     ) \
0426                 ) \
0427             ) \
0428         ) \
0429     (d,state,id) \
0430 /**/
0431 
0432 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_RETURN(d,state,id) \
0433     BOOST_PP_IIF \
0434         ( \
0435         BOOST_VMD_DETAIL_IS_RETURN_TYPE_TUPLE(id), \
0436         BOOST_VMD_DETAIL_MODS_OP_CURRENT_GTT, \
0437         BOOST_PP_IIF \
0438             ( \
0439             BOOST_VMD_DETAIL_IS_RETURN_TYPE(id), \
0440             BOOST_VMD_DETAIL_MODS_OP_CURRENT_ET, \
0441             BOOST_PP_IIF \
0442                 ( \
0443                 BOOST_VMD_DETAIL_IS_RETURN_TYPE_ARRAY(id), \
0444                 BOOST_VMD_DETAIL_MODS_OP_CURRENT_SA, \
0445                 BOOST_PP_IIF \
0446                     ( \
0447                     BOOST_VMD_DETAIL_IS_RETURN_TYPE_LIST(id), \
0448                     BOOST_VMD_DETAIL_MODS_OP_CURRENT_SL, \
0449                     BOOST_PP_IIF \
0450                         ( \
0451                         BOOST_VMD_DETAIL_IS_RETURN_NO_TYPE(id), \
0452                         BOOST_VMD_DETAIL_MODS_OP_CURRENT_NT, \
0453                         BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN \
0454                         ) \
0455                     ) \
0456                 ) \
0457             ) \
0458         ) \
0459     (d,state,id) \
0460 /**/
0461 
0462 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_AFTER(d,state,id) \
0463     BOOST_PP_IIF \
0464         ( \
0465         BOOST_VMD_DETAIL_IS_RETURN_AFTER(id), \
0466         BOOST_VMD_DETAIL_MODS_OP_CURRENT_AFT, \
0467         BOOST_PP_IIF \
0468             ( \
0469             BOOST_VMD_DETAIL_IS_RETURN_NO_AFTER(id), \
0470             BOOST_VMD_DETAIL_MODS_OP_CURRENT_NOAFT, \
0471             BOOST_PP_IIF \
0472                 ( \
0473                 BOOST_VMD_DETAIL_IS_RETURN_ONLY_AFTER(id), \
0474                 BOOST_VMD_DETAIL_MODS_OP_CURRENT_ONLY_AFTER, \
0475                 BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN \
0476                 ) \
0477             ) \
0478         ) \
0479     (d,state,id) \
0480 /**/
0481 
0482 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_INDEX(d,state,id) \
0483     BOOST_PP_IIF \
0484         ( \
0485         BOOST_VMD_DETAIL_IS_RETURN_AFTER(id), \
0486         BOOST_VMD_DETAIL_MODS_OP_CURRENT_AFT, \
0487         BOOST_PP_IIF \
0488             ( \
0489             BOOST_VMD_DETAIL_IS_RETURN_NO_AFTER(id), \
0490             BOOST_VMD_DETAIL_MODS_OP_CURRENT_NOAFT, \
0491             BOOST_PP_IIF \
0492                 ( \
0493                 BOOST_VMD_DETAIL_IS_RETURN_ONLY_AFTER(id), \
0494                 BOOST_VMD_DETAIL_MODS_OP_CURRENT_ONLY_AFTER, \
0495                 BOOST_PP_IIF \
0496                     ( \
0497                     BOOST_VMD_DETAIL_IS_RETURN_INDEX(id), \
0498                     BOOST_VMD_DETAIL_MODS_OP_CURRENT_IND, \
0499                     BOOST_PP_IIF \
0500                         ( \
0501                         BOOST_VMD_DETAIL_IS_RETURN_NO_INDEX(id), \
0502                         BOOST_VMD_DETAIL_MODS_OP_CURRENT_NO_IND, \
0503                         BOOST_VMD_DETAIL_MODS_OP_CURRENT_UNKNOWN \
0504                         ) \
0505                     ) \
0506                 ) \
0507             ) \
0508         ) \
0509     (d,state,id) \
0510 /**/
0511 
0512 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_UPDATE(d,state,id) \
0513     BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE(d,state) \
0514 /**/
0515 
0516 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_ID(d,state,id) \
0517     BOOST_PP_IIF \
0518         ( \
0519         BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_ALL(state), \
0520         BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_ALL, \
0521         BOOST_PP_IIF \
0522             ( \
0523             BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_RETURN(state), \
0524             BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_RETURN, \
0525             BOOST_PP_IIF \
0526                 ( \
0527                 BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_AFTER(state), \
0528                 BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_AFTER, \
0529                 BOOST_PP_IIF \
0530                     ( \
0531                     BOOST_VMD_DETAIL_MODS_STATE_IS_ALLOW_INDEX(state), \
0532                     BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_INDEX, \
0533                     BOOST_VMD_DETAIL_MODS_OP_CURRENT_ALLOW_UPDATE \
0534                     ) \
0535                 ) \
0536             ) \
0537         ) \
0538     (d,state,id) \
0539 /**/
0540 
0541 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT_TUPLE(d,state,id) \
0542     BOOST_VMD_DETAIL_MODS_OP_CURRENT_UPDATE \
0543         ( \
0544         d, \
0545         BOOST_PP_TUPLE_REPLACE_D \
0546             ( \
0547             d, \
0548             state, \
0549             BOOST_VMD_DETAIL_MODS_DATA_RESULT, \
0550             BOOST_PP_TUPLE_REPLACE_D \
0551                 ( \
0552                 d, \
0553                 BOOST_VMD_DETAIL_MODS_STATE_RESULT(state), \
0554                 BOOST_VMD_DETAIL_MODS_TUPLE_OTHER, \
0555                 id \
0556                 ) \
0557             ) \
0558         ) \
0559 /**/
0560 
0561 #define BOOST_VMD_DETAIL_MODS_OP_CURRENT(d,state,id) \
0562     BOOST_PP_IIF \
0563         ( \
0564         BOOST_PP_IS_BEGIN_PARENS(id), \
0565         BOOST_VMD_DETAIL_MODS_OP_CURRENT_TUPLE, \
0566         BOOST_VMD_DETAIL_MODS_OP_CURRENT_ID \
0567         ) \
0568     (d,state,id) \
0569 /**/
0570 
0571 #define BOOST_VMD_DETAIL_MODS_OP(d,state) \
0572     BOOST_VMD_DETAIL_MODS_OP_CURRENT(d,state,BOOST_VMD_DETAIL_MODS_STATE_CURRENT(state)) \
0573 /**/
0574 
0575 #define BOOST_VMD_DETAIL_MODS_LOOP(allow,tuple) \
0576     BOOST_PP_TUPLE_ELEM \
0577         ( \
0578         3, \
0579         BOOST_PP_WHILE \
0580             ( \
0581             BOOST_VMD_DETAIL_MODS_PRED, \
0582             BOOST_VMD_DETAIL_MODS_OP, \
0583                 ( \
0584                 tuple, \
0585                 0, \
0586                 BOOST_PP_TUPLE_SIZE(tuple), \
0587                 (0,0,0,,0,), \
0588                 allow \
0589                 ) \
0590             ) \
0591         ) \
0592 /**/
0593 
0594 #define BOOST_VMD_DETAIL_MODS_LOOP_D(d,allow,tuple) \
0595     BOOST_PP_TUPLE_ELEM \
0596         ( \
0597         3, \
0598         BOOST_PP_WHILE_ ## d \
0599             ( \
0600             BOOST_VMD_DETAIL_MODS_PRED, \
0601             BOOST_VMD_DETAIL_MODS_OP, \
0602                 ( \
0603                 tuple, \
0604                 0, \
0605                 BOOST_PP_TUPLE_SIZE(tuple), \
0606                 (0,0,0,,0,), \
0607                 allow \
0608                 ) \
0609             ) \
0610         ) \
0611 /**/
0612 
0613 #define BOOST_VMD_DETAIL_NEW_MODS_VAR(allow,tuple) \
0614     BOOST_VMD_DETAIL_MODS_LOOP \
0615         ( \
0616         allow, \
0617         BOOST_PP_TUPLE_POP_FRONT(tuple) \
0618         ) \
0619 /**/
0620 
0621 #define BOOST_VMD_DETAIL_NEW_MODS_VAR_D(d,allow,tuple) \
0622     BOOST_VMD_DETAIL_MODS_LOOP_D \
0623         ( \
0624         d, \
0625         allow, \
0626         BOOST_PP_TUPLE_POP_FRONT(tuple) \
0627         ) \
0628 /**/
0629 
0630 #define BOOST_VMD_DETAIL_NEW_MODS_IR(allow,tuple) \
0631     BOOST_VMD_IDENTITY_RESULT \
0632         ( \
0633         BOOST_PP_IIF \
0634             ( \
0635             BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(tuple),1), \
0636             BOOST_VMD_IDENTITY((0,0,0,,0,)), \
0637             BOOST_VMD_DETAIL_NEW_MODS_VAR \
0638             ) \
0639         (allow,tuple) \
0640         ) \
0641 /**/
0642 
0643 #define BOOST_VMD_DETAIL_NEW_MODS_IR_D(d,allow,tuple) \
0644     BOOST_VMD_IDENTITY_RESULT \
0645         ( \
0646         BOOST_PP_IIF \
0647             ( \
0648             BOOST_PP_EQUAL_D(d,BOOST_PP_TUPLE_SIZE(tuple),1), \
0649             BOOST_VMD_IDENTITY((0,0,0,,0,)), \
0650             BOOST_VMD_DETAIL_NEW_MODS_VAR_D \
0651             ) \
0652         (d,allow,tuple) \
0653         ) \
0654 /**/
0655 
0656 /*
0657 
0658   Returns a six-element tuple:
0659   
0660   First tuple element  = 0 No type return
0661                          1 Exact type return
0662                          2 General tuple type return
0663                          3 Array return
0664                          4 List return
0665                          
0666   Second tuple element = 0 No after return
0667                          1 After return
0668                          
0669   Third tuple element  = 0 No identifier index
0670                          1 Identifier Index
0671                          
0672   Fourth tuple element = Tuple of other identifiers
0673   
0674   Fifth tuple element  = 0 No after only return
0675                          1 After only return
0676                          
0677   Sixth tuple element  = Type identifier
0678                          
0679   Input                = allow, either
0680                          BOOST_VMD_ALLOW_ALL
0681                          BOOST_VMD_ALLOW_RETURN
0682                          BOOST_VMD_ALLOW_AFTER
0683                          BOOST_VMD_ALLOW_INDEX
0684                          
0685                            ..., modifiers, first variadic is discarded
0686                          Possible modifiers are:
0687                          
0688                          BOOST_VMD_RETURN_NO_TYPE = (0,0)
0689                          BOOST_VMD_RETURN_TYPE = (1,0)
0690                          BOOST_VMD_RETURN_TYPE_TUPLE = (2,0)
0691                          BOOST_VMD_RETURN_TYPE_ARRAY = (3,0)
0692                          BOOST_VMD_RETURN_TYPE_LIST = (4,0)
0693                          
0694                          BOOST_VMD_RETURN_NO_AFTER = (0,0)
0695                          BOOST_VMD_RETURN_AFTER = (0,1)
0696   
0697 */
0698 
0699 #define BOOST_VMD_DETAIL_NEW_MODS(allow,...) \
0700     BOOST_VMD_DETAIL_NEW_MODS_IR(allow,BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__)) \
0701 /**/
0702 
0703 #define BOOST_VMD_DETAIL_NEW_MODS_D(d,allow,...) \
0704     BOOST_VMD_DETAIL_NEW_MODS_IR_D(d,allow,BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__)) \
0705 /**/
0706 
0707 #endif /* BOOST_VMD_DETAIL_MODS_HPP */