Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:01:20

0001 
0002 //  (C) Copyright Edward Diener 2011,2012,2013
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_TTI_HAS_STATIC_MEMBER_DATA_HPP)
0008 #define BOOST_TTI_HAS_STATIC_MEMBER_DATA_HPP
0009 
0010 #include <boost/config.hpp>
0011 #include <boost/preprocessor/cat.hpp>
0012 #include <boost/tti/gen/has_static_member_data_gen.hpp>
0013 #include <boost/tti/detail/dstatic_mem_data.hpp>
0014 
0015 /*
0016 
0017   The succeeding comments in this file are in doxygen format.
0018 
0019 */
0020 
0021 /** \file
0022 */
0023 
0024 /// A macro which expands to a metafunction which tests whether a static member data with a particular name and type exists.
0025 /**
0026 
0027     BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA is a macro which expands to a metafunction.
0028     The metafunction tests whether static member data with a particular
0029     name and type exists. The macro takes the form of BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) where
0030     
0031     trait = the name of the metafunction <br/>
0032     name  = the name of the inner member.
0033 
0034     BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA generates a metafunction called "trait" where 'trait' is the macro parameter.
0035     
0036   @code
0037   
0038               template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE>
0039               struct trait
0040                 {
0041                 static const value = unspecified;
0042                 typedef mpl::bool_<true-or-false> type;
0043                 };
0044 
0045               The metafunction types and return:
0046     
0047                 BOOST_TTI_TP_T    = the enclosing type.
0048                                     The enclosing type can be a class, struct, or union.
0049                                     If the type is a union, static member data can only
0050                                     be found if the C++11 unrestricted union is implemented
0051                                     by the compiler being used, since prior to C++11 a union
0052                                     could not have static data members.
0053                 
0054                 BOOST_TTI_TP_TYPE = the type of the static member data.
0055                        
0056                 returns = 'value' is true if the 'name' exists,
0057                           with the BOOST_TTI_TP_TYPE type,
0058                           within the enclosing BOOST_TTI_TP_T type,
0059                           otherwise 'value' is false.
0060                           
0061   @endcode
0062   
0063 */
0064 #define BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \
0065   BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \
0066   template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE> \
0067   struct trait \
0068     { \
0069     typedef typename \
0070     BOOST_PP_CAT(trait,_detail_hsd)<BOOST_TTI_TP_T,BOOST_TTI_TP_TYPE>::type type; \
0071     BOOST_STATIC_CONSTANT(bool,value=type::value); \
0072     }; \
0073 /**/
0074 
0075 /// A macro which expands to a metafunction which tests whether a static member data with a particular name and type exists.
0076 /**
0077 
0078     BOOST_TTI_HAS_STATIC_MEMBER_DATA is a macro which expands to a metafunction.
0079     The metafunction tests whether static member data with a particular
0080     name and type exists. The macro takes the form of BOOST_TTI_HAS_STATIC_MEMBER_DATA(name) where
0081     
0082     name  = the name of the inner member.
0083 
0084     BOOST_TTI_HAS_STATIC_MEMBER_DATA generates a metafunction called "has_static_member_data_name" where 'name' is the macro parameter.
0085     
0086   @code
0087   
0088               template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE>
0089               struct has_static_member_data_'name'
0090                 {
0091                 static const value = unspecified;
0092                 typedef mpl::bool_<true-or-false> type;
0093                 };
0094 
0095               The metafunction types and return:
0096     
0097                 BOOST_TTI_TP_T    = the enclosing type.
0098                                     The enclosing type can be a class, struct, or union.
0099                                     If the type is a union, static member data can only
0100                                     be found if the C++11 unrestricted union is implemented
0101                                     by the compiler being used, since prior to C++11 a union
0102                                     could not have static data members.
0103                 
0104                 BOOST_TTI_TP_TYPE = the type of the static member data.
0105                        
0106                 returns = 'value' is true if the 'name' exists,
0107                           with the appropriate BOOST_TTI_TP_TYPE type,
0108                           within the enclosing BOOST_TTI_TP_T type,
0109                           otherwise 'value' is false.
0110                           
0111   @endcode
0112   
0113 */
0114 #define BOOST_TTI_HAS_STATIC_MEMBER_DATA(name) \
0115   BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA \
0116   ( \
0117   BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(name), \
0118   name \
0119   ) \
0120 /**/
0121 
0122 #endif // BOOST_TTI_HAS_STATIC_MEMBER_DATA_HPP