2 // (C) Copyright Edward Diener 2011,2012,2013
3 // Use, modification and distribution are subject to the Boost Software License,
4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt).
7 #if !defined(BOOST_TTI_HAS_STATIC_MEMBER_DATA_HPP)
8 #define BOOST_TTI_HAS_STATIC_MEMBER_DATA_HPP
10 #include <boost/config.hpp>
11 #include <boost/preprocessor/cat.hpp>
12 #include <boost/tti/gen/has_static_member_data_gen.hpp>
13 #include <boost/tti/detail/dstatic_mem_data.hpp>
17 The succeeding comments in this file are in doxygen format.
24 /// A macro which expands to a metafunction which tests whether a static member data with a particular name and type exists.
27 BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA is a macro which expands to a metafunction.
28 The metafunction tests whether static member data with a particular
29 name and type exists. The macro takes the form of BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) where
31 trait = the name of the metafunction <br/>
32 name = the name of the inner member.
34 BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA generates a metafunction called "trait" where 'trait' is the macro parameter.
38 template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE>
41 static const value = unspecified;
42 typedef mpl::bool_<true-or-false> type;
45 The metafunction types and return:
47 BOOST_TTI_TP_T = the enclosing type.
48 The enclosing type can be a class, struct, or union.
49 If the type is a union, static member data can only
50 be found if the C++11 unrestricted union is implemented
51 by the compiler being used, since prior to C++11 a union
52 could not have static data members.
54 BOOST_TTI_TP_TYPE = the type of the static member data.
56 returns = 'value' is true if the 'name' exists,
57 with the BOOST_TTI_TP_TYPE type,
58 within the enclosing BOOST_TTI_TP_T type,
59 otherwise 'value' is false.
64 #define BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \
65 BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \
66 template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE> \
70 BOOST_PP_CAT(trait,_detail_hsd)<BOOST_TTI_TP_T,BOOST_TTI_TP_TYPE>::type type; \
71 BOOST_STATIC_CONSTANT(bool,value=type::value); \
75 /// A macro which expands to a metafunction which tests whether a static member data with a particular name and type exists.
78 BOOST_TTI_HAS_STATIC_MEMBER_DATA is a macro which expands to a metafunction.
79 The metafunction tests whether static member data with a particular
80 name and type exists. The macro takes the form of BOOST_TTI_HAS_STATIC_MEMBER_DATA(name) where
82 name = the name of the inner member.
84 BOOST_TTI_HAS_STATIC_MEMBER_DATA generates a metafunction called "has_static_member_data_name" where 'name' is the macro parameter.
88 template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE>
89 struct has_static_member_data_'name'
91 static const value = unspecified;
92 typedef mpl::bool_<true-or-false> type;
95 The metafunction types and return:
97 BOOST_TTI_TP_T = the enclosing type.
98 The enclosing type can be a class, struct, or union.
99 If the type is a union, static member data can only
100 be found if the C++11 unrestricted union is implemented
101 by the compiler being used, since prior to C++11 a union
102 could not have static data members.
104 BOOST_TTI_TP_TYPE = the type of the static member data.
106 returns = 'value' is true if the 'name' exists,
107 with the appropriate BOOST_TTI_TP_TYPE type,
108 within the enclosing BOOST_TTI_TP_T type,
109 otherwise 'value' is false.
114 #define BOOST_TTI_HAS_STATIC_MEMBER_DATA(name) \
115 BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA \
117 BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(name), \
122 #endif // BOOST_TTI_HAS_STATIC_MEMBER_DATA_HPP