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_IDENTIFIER_TYPE_HPP)
0008 #define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_HPP
0009 
0010 #include <boost/preprocessor/cat.hpp>
0011 #include <boost/preprocessor/comparison/equal.hpp>
0012 #include <boost/preprocessor/control/iif.hpp>
0013 #include <boost/preprocessor/tuple/elem.hpp>
0014 #include <boost/preprocessor/tuple/size.hpp>
0015 #include <boost/vmd/identity.hpp>
0016 #include <boost/vmd/is_tuple.hpp>
0017 #include <boost/vmd/detail/idprefix.hpp>
0018 #include <boost/vmd/detail/number_registration.hpp>
0019 #include <boost/vmd/detail/type_registration.hpp>
0020 
0021 #define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCATENATE(id) \
0022     BOOST_PP_CAT \
0023         ( \
0024         BOOST_VMD_DETAIL_IDENTIFIER_SUBTYPE_REGISTRATION_PREFIX, \
0025         id \
0026         ) \
0027 /**/
0028 
0029 #define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_SIZE(cres) \
0030     BOOST_VMD_IDENTITY_RESULT \
0031         ( \
0032         BOOST_PP_IIF \
0033             ( \
0034             BOOST_PP_EQUAL \
0035                 ( \
0036                 BOOST_PP_TUPLE_SIZE(cres), \
0037                 2 \
0038                 ), \
0039             BOOST_PP_TUPLE_ELEM, \
0040             BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_IDENTIFIER) \
0041             ) \
0042         (0,cres) \
0043         ) \
0044 /**/
0045 
0046 #define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_SIZE_D(d,cres) \
0047     BOOST_VMD_IDENTITY_RESULT \
0048         ( \
0049         BOOST_PP_IIF \
0050             ( \
0051             BOOST_PP_EQUAL_D \
0052                 ( \
0053                 d, \
0054                 BOOST_PP_TUPLE_SIZE(cres), \
0055                 2 \
0056                 ), \
0057             BOOST_PP_TUPLE_ELEM, \
0058             BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_IDENTIFIER) \
0059             ) \
0060         (0,cres) \
0061         ) \
0062 /**/
0063 
0064 #define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCAT(cres) \
0065     BOOST_VMD_IDENTITY_RESULT \
0066         ( \
0067         BOOST_PP_IIF \
0068             ( \
0069             BOOST_VMD_IS_TUPLE(cres), \
0070             BOOST_VMD_DETAIL_IDENTIFIER_TYPE_SIZE, \
0071             BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_IDENTIFIER) \
0072             ) \
0073         (cres) \
0074         ) \
0075 /**/
0076 
0077 #define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCAT_D(d,cres) \
0078     BOOST_VMD_IDENTITY_RESULT \
0079         ( \
0080         BOOST_PP_IIF \
0081             ( \
0082             BOOST_VMD_IS_TUPLE(cres), \
0083             BOOST_VMD_DETAIL_IDENTIFIER_TYPE_SIZE_D, \
0084             BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_IDENTIFIER) \
0085             ) \
0086         (d,cres) \
0087         ) \
0088 /**/
0089 
0090 /*
0091 
0092   Determines the type of an identifier.
0093   
0094   The type may be that of an identifier or else
0095   it may be a subtype.
0096   
0097   Assumes the 'id' is a valid identifier id
0098   
0099   Expands to the appropriate type
0100 
0101 */
0102 
0103 #define BOOST_VMD_DETAIL_IDENTIFIER_TYPE(id) \
0104     BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCAT \
0105         ( \
0106         BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCATENATE(id) \
0107         ) \
0108 /**/
0109 
0110 #define BOOST_VMD_DETAIL_IDENTIFIER_TYPE_D(d,id) \
0111     BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCAT_D \
0112         ( \
0113         d, \
0114         BOOST_VMD_DETAIL_IDENTIFIER_TYPE_CONCATENATE(id) \
0115         ) \
0116 /**/
0117 
0118 #endif /* BOOST_VMD_DETAIL_IDENTIFIER_TYPE_HPP */