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 /// Expands to a metafunction which tests whether a static member data with a particular name and type exists.
27 trait = the name of the metafunction within the tti namespace.
29 name = the name of the inner member.
31 generates a metafunction called "trait" where 'trait' is the macro parameter.
33 The metafunction types and return:
35 BOOST_TTI_TP_T = the enclosing type.
37 BOOST_TTI_TP_TYPE = the static member data type,
38 in the form of a data type,
39 in which to look for our 'name'.
41 returns = 'value' is true if the 'name' exists,
42 with the BOOST_TTI_TP_TYPE type,
43 within the enclosing BOOST_TTI_TP_T type,
44 otherwise 'value' is false.
47 #define BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \
48 BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \
49 template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE> \
53 BOOST_PP_CAT(trait,_detail_hsd)<BOOST_TTI_TP_T,BOOST_TTI_TP_TYPE>::type type; \
54 BOOST_STATIC_CONSTANT(bool,value=type::value); \
58 /// Expands to a metafunction which tests whether a static member data with a particular name and type exists.
61 name = the name of the inner member.
63 generates a metafunction called "has_static_member_data_name" where 'name' is the macro parameter.
65 The metafunction types and return:
67 BOOST_TTI_TP_T = the enclosing type.
69 BOOST_TTI_TP_TYPE = the static member data type,
70 in the form of a data type,
71 in which to look for our 'name'.
73 returns = 'value' is true if the 'name' exists,
74 with the appropriate BOOST_TTI_TP_TYPE type,
75 within the enclosing BOOST_TTI_TP_T type,
76 otherwise 'value' is false.
79 #define BOOST_TTI_HAS_STATIC_MEMBER_DATA(name) \
80 BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA \
82 BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(name), \
87 #endif // BOOST_TTI_HAS_STATIC_MEMBER_DATA_HPP