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_IS_ARRAY_COMMON_HPP)
0008 #define BOOST_VMD_DETAIL_IS_ARRAY_COMMON_HPP
0009 
0010 #include <boost/preprocessor/cat.hpp>
0011 #include <boost/preprocessor/comparison/equal.hpp>
0012 #include <boost/preprocessor/control/if.hpp>
0013 #include <boost/preprocessor/control/iif.hpp>
0014 #include <boost/preprocessor/facilities/empty.hpp>
0015 #include <boost/preprocessor/tuple/elem.hpp>
0016 #include <boost/preprocessor/tuple/size.hpp>
0017 #include <boost/vmd/identity.hpp>
0018 #include <boost/vmd/is_empty.hpp>
0019 #include <boost/vmd/is_number.hpp>
0020 #include <boost/vmd/is_tuple.hpp>
0021 #include <boost/vmd/detail/is_empty_tuple.hpp>
0022 
0023 #define BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX(tuple) \
0024     BOOST_VMD_IDENTITY_RESULT \
0025         ( \
0026         BOOST_PP_IIF \
0027             ( \
0028             BOOST_PP_EQUAL(2,BOOST_PP_TUPLE_SIZE(tuple)), \
0029             BOOST_VMD_DETAIL_IS_ARRAY_CHECK_ARRAY_FORM, \
0030             BOOST_VMD_IDENTITY(0) \
0031             ) \
0032         (tuple) \
0033         ) \
0034 /**/
0035 
0036 #define BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX_D(d,tuple) \
0037     BOOST_VMD_IDENTITY_RESULT \
0038         ( \
0039         BOOST_PP_IIF \
0040             ( \
0041             BOOST_PP_EQUAL_D(d,2,BOOST_PP_TUPLE_SIZE(tuple)), \
0042             BOOST_VMD_DETAIL_IS_ARRAY_CHECK_ARRAY_FORM_D, \
0043             BOOST_VMD_IDENTITY(0) \
0044             ) \
0045         (d,tuple) \
0046         ) \
0047 /**/
0048 
0049 /*
0050 
0051   Check if the first element of the tuple is equal to the number of tuple elements of the second element
0052 
0053 */
0054 
0055 #define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH_SIZE(x) \
0056     BOOST_PP_EQUAL(BOOST_PP_TUPLE_ELEM(0,x),BOOST_PP_TUPLE_SIZE(BOOST_PP_TUPLE_ELEM(1,x))) \
0057 /**/
0058 
0059 #define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH_SIZE_D(d,x) \
0060     BOOST_PP_EQUAL_D(d,BOOST_PP_TUPLE_ELEM(0,x),BOOST_PP_TUPLE_SIZE(BOOST_PP_TUPLE_ELEM(1,x))) \
0061 /**/
0062 
0063 #define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_EMPTY(tuple) \
0064     BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_SIZE(BOOST_PP_TUPLE_ELEM(1,tuple)) \
0065 /**/
0066 
0067 #define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_EMPTY_D(d,tuple) \
0068     BOOST_VMD_DETAIL_IS_EMPTY_TUPLE_SIZE(BOOST_PP_TUPLE_ELEM(1,tuple)) \
0069 /**/
0070 
0071 #define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH(tuple) \
0072     BOOST_PP_IF \
0073         ( \
0074         BOOST_PP_TUPLE_ELEM(0,tuple), \
0075         BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH_SIZE, \
0076         BOOST_VMD_DETAIL_IS_ARRAY_CHECK_EMPTY \
0077         ) \
0078     (tuple) \
0079 /**/
0080 
0081 #define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH_D(d,tuple) \
0082     BOOST_PP_IF \
0083         ( \
0084         BOOST_PP_TUPLE_ELEM(0,tuple), \
0085         BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH_SIZE_D, \
0086         BOOST_VMD_DETAIL_IS_ARRAY_CHECK_EMPTY_D \
0087         ) \
0088     (d,tuple) \
0089 /**/
0090 
0091 /*
0092 
0093   Check if the first element is numeric
0094 
0095 */
0096 
0097 #define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC(tuple) \
0098     BOOST_VMD_IDENTITY_RESULT \
0099         ( \
0100         BOOST_PP_IIF \
0101           ( \
0102           BOOST_VMD_DETAIL_IS_ARRAY_NUM(BOOST_PP_TUPLE_ELEM(0,tuple)), \
0103           BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH, \
0104           BOOST_VMD_IDENTITY(0) \
0105           ) \
0106         (tuple) \
0107         ) \
0108 /**/
0109 
0110 #define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_D(d,tuple) \
0111     BOOST_VMD_IDENTITY_RESULT \
0112         ( \
0113         BOOST_PP_IIF \
0114           ( \
0115           BOOST_VMD_DETAIL_IS_ARRAY_NUM(BOOST_PP_TUPLE_ELEM(0,tuple)), \
0116           BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_MATCH_D, \
0117           BOOST_VMD_IDENTITY(0) \
0118           ) \
0119         (d,tuple) \
0120         ) \
0121 /**/
0122 
0123 #define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMBER(tuple) \
0124     BOOST_VMD_IDENTITY_RESULT \
0125         ( \
0126         BOOST_PP_IIF \
0127             ( \
0128             BOOST_VMD_IS_NUMBER(BOOST_PP_TUPLE_ELEM(0,tuple)), \
0129             BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC, \
0130             BOOST_VMD_IDENTITY(0) \
0131             ) \
0132         (tuple) \
0133         ) \
0134 /**/
0135 
0136 #define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMBER_D(d,tuple) \
0137     BOOST_VMD_IDENTITY_RESULT \
0138         ( \
0139         BOOST_PP_IIF \
0140             ( \
0141             BOOST_VMD_IS_NUMBER(BOOST_PP_TUPLE_ELEM(0,tuple)), \
0142             BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMERIC_D, \
0143             BOOST_VMD_IDENTITY(0) \
0144             ) \
0145         (d,tuple) \
0146         ) \
0147 /**/
0148 
0149 /*
0150 
0151   Check if the second element is a tuple
0152 
0153 */
0154 
0155 #define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_ARRAY_FORM(tuple) \
0156     BOOST_VMD_IDENTITY_RESULT \
0157         ( \
0158         BOOST_PP_IIF \
0159           ( \
0160           BOOST_VMD_IS_TUPLE(BOOST_PP_TUPLE_ELEM(1,tuple)), \
0161           BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMBER, \
0162           BOOST_VMD_IDENTITY(0) \
0163           ) \
0164         (tuple) \
0165         ) \
0166 /**/
0167 
0168 #define BOOST_VMD_DETAIL_IS_ARRAY_CHECK_ARRAY_FORM_D(d,tuple) \
0169     BOOST_VMD_IDENTITY_RESULT \
0170         ( \
0171         BOOST_PP_IIF \
0172           ( \
0173           BOOST_VMD_IS_TUPLE(BOOST_PP_TUPLE_ELEM(1,tuple)), \
0174           BOOST_VMD_DETAIL_IS_ARRAY_CHECK_NUMBER_D, \
0175           BOOST_VMD_IDENTITY(0) \
0176           ) \
0177         (d,tuple) \
0178         ) \
0179 /**/
0180 
0181 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM(x) BOOST_VMD_IS_EMPTY(BOOST_PP_CAT(BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_, x) BOOST_PP_EMPTY())
0182 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_0
0183 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_1
0184 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_2
0185 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_3
0186 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_4
0187 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_5
0188 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_6
0189 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_7
0190 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_8
0191 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_9
0192 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_10
0193 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_11
0194 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_12
0195 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_13
0196 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_14
0197 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_15
0198 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_16
0199 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_17
0200 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_18
0201 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_19
0202 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_20
0203 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_21
0204 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_22
0205 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_23
0206 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_24
0207 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_25
0208 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_26
0209 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_27
0210 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_28
0211 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_29
0212 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_30
0213 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_31
0214 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_32
0215 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_33
0216 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_34
0217 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_35
0218 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_36
0219 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_37
0220 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_38
0221 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_39
0222 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_40
0223 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_41
0224 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_42
0225 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_43
0226 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_44
0227 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_45
0228 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_46
0229 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_47
0230 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_48
0231 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_49
0232 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_50
0233 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_51
0234 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_52
0235 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_53
0236 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_54
0237 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_55
0238 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_56
0239 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_57
0240 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_58
0241 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_59
0242 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_60
0243 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_61
0244 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_62
0245 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_63
0246 #define BOOST_VMD_DETAIL_IS_ARRAY_NUM_HELPER_64
0247 
0248 #endif /* BOOST_VMD_DETAIL_IS_ARRAY_COMMON_HPP */