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_ARRAY_HPP)
0008 #define BOOST_VMD_DETAIL_ARRAY_HPP
0009 
0010 #include <boost/preprocessor/control/expr_iif.hpp>
0011 #include <boost/preprocessor/control/iif.hpp>
0012 #include <boost/preprocessor/tuple/elem.hpp>
0013 #include <boost/preprocessor/variadic/elem.hpp>
0014 #include <boost/vmd/empty.hpp>
0015 #include <boost/vmd/identity.hpp>
0016 #include <boost/vmd/is_empty.hpp>
0017 #include <boost/vmd/detail/empty_result.hpp>
0018 #include <boost/vmd/detail/is_array_common.hpp>
0019 #include <boost/vmd/detail/mods.hpp>
0020 #include <boost/vmd/detail/tuple.hpp>
0021 
0022 #define BOOST_VMD_DETAIL_ARRAY_CHECK_FOR_ARRAY(tuple) \
0023     BOOST_VMD_IDENTITY_RESULT \
0024         ( \
0025         BOOST_PP_IIF \
0026             ( \
0027             BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX \
0028                 ( \
0029                 BOOST_PP_TUPLE_ELEM \
0030                     ( \
0031                     0, \
0032                     tuple \
0033                     ) \
0034                 ), \
0035             BOOST_VMD_IDENTITY(tuple), \
0036             BOOST_VMD_DETAIL_EMPTY_RESULT \
0037             ) \
0038         (tuple)    \
0039         ) \
0040 /**/
0041 
0042 #define BOOST_VMD_DETAIL_ARRAY_CHECK_FOR_ARRAY_D(d,tuple) \
0043     BOOST_VMD_IDENTITY_RESULT \
0044         ( \
0045         BOOST_PP_IIF \
0046             ( \
0047             BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX_D \
0048                 ( \
0049                 d, \
0050                 BOOST_PP_TUPLE_ELEM \
0051                     ( \
0052                     0, \
0053                     tuple \
0054                     ) \
0055                 ), \
0056             BOOST_VMD_IDENTITY(tuple), \
0057             BOOST_VMD_DETAIL_EMPTY_RESULT \
0058             ) \
0059         (tuple)    \
0060         ) \
0061 /**/
0062 
0063 #define BOOST_VMD_DETAIL_ARRAY_PROCESS(tuple) \
0064     BOOST_PP_IIF \
0065         ( \
0066         BOOST_VMD_IS_EMPTY \
0067             ( \
0068             BOOST_PP_TUPLE_ELEM \
0069                 ( \
0070                 0, \
0071                 tuple \
0072                 ) \
0073             ), \
0074         BOOST_VMD_DETAIL_EMPTY_RESULT, \
0075         BOOST_VMD_DETAIL_ARRAY_CHECK_FOR_ARRAY \
0076         ) \
0077     (tuple) \
0078 /**/
0079 
0080 #define BOOST_VMD_DETAIL_ARRAY_PROCESS_D(d,tuple) \
0081     BOOST_PP_IIF \
0082         ( \
0083         BOOST_VMD_IS_EMPTY \
0084             ( \
0085             BOOST_PP_TUPLE_ELEM \
0086                 ( \
0087                 0, \
0088                 tuple \
0089                 ) \
0090             ), \
0091         BOOST_VMD_DETAIL_EMPTY_RESULT, \
0092         BOOST_VMD_DETAIL_ARRAY_CHECK_FOR_ARRAY_D \
0093         ) \
0094     (d,tuple) \
0095 /**/
0096 
0097 #define BOOST_VMD_DETAIL_ARRAY_SPLIT(param) \
0098     BOOST_VMD_DETAIL_ARRAY_PROCESS \
0099         ( \
0100         BOOST_VMD_DETAIL_TUPLE(param,BOOST_VMD_RETURN_AFTER) \
0101         ) \
0102 /**/
0103 
0104 #define BOOST_VMD_DETAIL_ARRAY_SPLIT_D(d,param) \
0105     BOOST_VMD_DETAIL_ARRAY_PROCESS_D \
0106         ( \
0107         d, \
0108         BOOST_VMD_DETAIL_TUPLE_D(d,param,BOOST_VMD_RETURN_AFTER) \
0109         ) \
0110 /**/
0111 
0112 #define BOOST_VMD_DETAIL_ARRAY_BEGIN_CHECK_FOR_ARRAY(tuple) \
0113     BOOST_PP_EXPR_IIF \
0114         ( \
0115         BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX(tuple), \
0116         tuple \
0117         ) \
0118 /**/
0119 
0120 #define BOOST_VMD_DETAIL_ARRAY_BEGIN_CHECK_FOR_ARRAY_D(d,tuple) \
0121     BOOST_PP_EXPR_IIF \
0122         ( \
0123         BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX_D(d,tuple), \
0124         tuple \
0125         ) \
0126 /**/
0127 
0128 #define BOOST_VMD_DETAIL_ARRAY_BEGIN_TUPLE(tuple) \
0129     BOOST_PP_IIF \
0130         ( \
0131         BOOST_VMD_IS_EMPTY(tuple), \
0132         BOOST_VMD_EMPTY, \
0133         BOOST_VMD_DETAIL_ARRAY_BEGIN_CHECK_FOR_ARRAY \
0134         ) \
0135     (tuple) \
0136 /**/
0137 
0138 #define BOOST_VMD_DETAIL_ARRAY_BEGIN_TUPLE_D(d,tuple) \
0139     BOOST_PP_IIF \
0140         ( \
0141         BOOST_VMD_IS_EMPTY(tuple), \
0142         BOOST_VMD_EMPTY, \
0143         BOOST_VMD_DETAIL_ARRAY_BEGIN_CHECK_FOR_ARRAY_D \
0144         ) \
0145     (d,tuple) \
0146 /**/
0147 
0148 #define BOOST_VMD_DETAIL_ARRAY_BEGIN(param) \
0149     BOOST_VMD_DETAIL_ARRAY_BEGIN_TUPLE \
0150         ( \
0151         BOOST_VMD_DETAIL_TUPLE(param) \
0152         ) \
0153 /**/
0154 
0155 #define BOOST_VMD_DETAIL_ARRAY_BEGIN_D(d,param) \
0156     BOOST_VMD_DETAIL_ARRAY_BEGIN_TUPLE_D \
0157         ( \
0158         d, \
0159         BOOST_VMD_DETAIL_TUPLE_D(d,param) \
0160         ) \
0161 /**/
0162 
0163 #define BOOST_VMD_DETAIL_ARRAY(...) \
0164     BOOST_PP_IIF \
0165         ( \
0166         BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \
0167             ( \
0168             BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \
0169             ), \
0170         BOOST_VMD_DETAIL_ARRAY_SPLIT, \
0171         BOOST_VMD_DETAIL_ARRAY_BEGIN \
0172         ) \
0173     (BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \
0174 /**/
0175 
0176 #define BOOST_VMD_DETAIL_ARRAY_D(d,...) \
0177     BOOST_PP_IIF \
0178         ( \
0179         BOOST_VMD_DETAIL_MODS_IS_RESULT_AFTER \
0180             ( \
0181             BOOST_VMD_DETAIL_NEW_MODS(BOOST_VMD_ALLOW_AFTER,__VA_ARGS__) \
0182             ), \
0183         BOOST_VMD_DETAIL_ARRAY_SPLIT_D, \
0184         BOOST_VMD_DETAIL_ARRAY_BEGIN_D \
0185         ) \
0186     (d,BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__)) \
0187 /**/
0188 
0189 #endif /* BOOST_VMD_DETAIL_ARRAY_HPP */