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_DETAIL_MEM_TYPE_HPP)
8 #define BOOST_TTI_DETAIL_MEM_TYPE_HPP
10 #include <boost/config.hpp>
11 #include <boost/mpl/bool.hpp>
12 #include <boost/mpl/eval_if.hpp>
13 #include <boost/mpl/has_xxx.hpp>
14 #include <boost/preprocessor/cat.hpp>
15 #include <boost/type_traits/is_class.hpp>
17 #define BOOST_TTI_DETAIL_TRAIT_HAS_TYPE_MEMBER_TYPE_OP(trait,name) \
18 BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(BOOST_PP_CAT(trait,_detail_mpl), name, false) \
19 template<class BOOST_TTI_DETAIL_TP_T> \
20 struct BOOST_PP_CAT(trait,_detail_op) : \
21 BOOST_PP_CAT(trait,_detail_mpl)<BOOST_TTI_DETAIL_TP_T> \
26 #define BOOST_TTI_DETAIL_TRAIT_HAS_TYPE_MEMBER_TYPE(trait,name) \
27 BOOST_TTI_DETAIL_TRAIT_HAS_TYPE_MEMBER_TYPE_OP(trait,name) \
28 template<class BOOST_TTI_DETAIL_TP_T> \
29 struct BOOST_PP_CAT(trait,_detail) \
34 boost::is_class<BOOST_TTI_DETAIL_TP_T>, \
35 BOOST_PP_CAT(trait,_detail_op)<BOOST_TTI_DETAIL_TP_T>, \
39 BOOST_STATIC_CONSTANT(bool,value=type::value); \
43 #define BOOST_TTI_DETAIL_TRAIT_MEMBER_TYPE(trait,name) \
44 template<class BOOST_TTI_DETAIL_TP_T> \
45 struct BOOST_PP_CAT(trait,_detail_member_type) \
47 typedef typename BOOST_TTI_DETAIL_TP_T::name type; \
51 #endif // BOOST_TTI_DETAIL_MEM_TYPE_HPP