File indexing completed on 2025-01-18 09:52:54
0001
0002
0003
0004
0005
0006
0007 #if !defined(BOOST_TTI_DETAIL_STATIC_MEM_DATA_HPP)
0008 #define BOOST_TTI_DETAIL_STATIC_MEM_DATA_HPP
0009
0010 #include <boost/config.hpp>
0011 #include <boost/function_types/is_function.hpp>
0012 #include <boost/mpl/bool.hpp>
0013 #include <boost/mpl/eval_if.hpp>
0014 #include <boost/preprocessor/cat.hpp>
0015 #include <boost/type_traits/is_class.hpp>
0016 #include <boost/type_traits/detail/yes_no_type.hpp>
0017 #include <boost/tti/detail/denclosing_type.hpp>
0018 #include <boost/tti/detail/dmacro_sunfix.hpp>
0019 #include <boost/tti/detail/dnullptr.hpp>
0020 #include <boost/tti/gen/namespace_gen.hpp>
0021
0022 #if defined(BOOST_MSVC)
0023
0024 #define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA_OP(trait,name) \
0025 template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_TYPE> \
0026 struct BOOST_PP_CAT(trait,_detail_hsd_op) \
0027 { \
0028 template<bool,typename BOOST_TTI_DETAIL_TP_U> \
0029 struct menable_if; \
0030 \
0031 template<typename BOOST_TTI_DETAIL_TP_U> \
0032 struct menable_if<true,BOOST_TTI_DETAIL_TP_U> \
0033 { \
0034 typedef BOOST_TTI_DETAIL_TP_U type; \
0035 }; \
0036 \
0037 template<typename BOOST_TTI_DETAIL_TP_U,typename BOOST_TTI_DETAIL_TP_V> \
0038 static ::boost::type_traits::yes_type check2(BOOST_TTI_DETAIL_TP_V *); \
0039 \
0040 template<typename BOOST_TTI_DETAIL_TP_U,typename BOOST_TTI_DETAIL_TP_V> \
0041 static ::boost::type_traits::no_type check2(BOOST_TTI_DETAIL_TP_U); \
0042 \
0043 template<typename BOOST_TTI_DETAIL_TP_U,typename BOOST_TTI_DETAIL_TP_V> \
0044 static typename \
0045 menable_if \
0046 < \
0047 sizeof(check2<BOOST_TTI_DETAIL_TP_U,BOOST_TTI_DETAIL_TP_V>(&BOOST_TTI_DETAIL_TP_U::name))==sizeof(::boost::type_traits::yes_type), \
0048 ::boost::type_traits::yes_type \
0049 > \
0050 ::type \
0051 has_matching_member(int); \
0052 \
0053 template<typename BOOST_TTI_DETAIL_TP_U,typename BOOST_TTI_DETAIL_TP_V> \
0054 static ::boost::type_traits::no_type has_matching_member(...); \
0055 \
0056 template<class BOOST_TTI_DETAIL_TP_U,class BOOST_TTI_DETAIL_TP_V> \
0057 struct ttc_sd \
0058 { \
0059 typedef boost::mpl::bool_<sizeof(has_matching_member<BOOST_TTI_DETAIL_TP_V,BOOST_TTI_DETAIL_TP_U>(0))==sizeof(::boost::type_traits::yes_type)> type; \
0060 }; \
0061 \
0062 typedef typename ttc_sd<BOOST_TTI_DETAIL_TP_TYPE,BOOST_TTI_DETAIL_TP_T>::type type; \
0063 }; \
0064
0065
0066 #else
0067
0068 #define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA_OP(trait,name) \
0069 template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_TYPE> \
0070 struct BOOST_PP_CAT(trait,_detail_hsd_op) \
0071 { \
0072 template<BOOST_TTI_DETAIL_TP_TYPE *> \
0073 struct helper BOOST_TTI_DETAIL_MACRO_SUNFIX ; \
0074 \
0075 template<class BOOST_TTI_DETAIL_TP_U> \
0076 static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_U::name> *); \
0077 \
0078 template<class BOOST_TTI_DETAIL_TP_U> \
0079 static ::boost::type_traits::no_type chkt(...); \
0080 \
0081 typedef boost::mpl::bool_<(!boost::function_types::is_function<BOOST_TTI_DETAIL_TP_TYPE>::value) && (sizeof(chkt<BOOST_TTI_DETAIL_TP_T>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type))> type; \
0082 }; \
0083
0084
0085 #endif
0086
0087 #if defined(BOOST_NO_CXX11_UNRESTRICTED_UNION)
0088
0089 #define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \
0090 BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA_OP(trait,name) \
0091 template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_TYPE> \
0092 struct BOOST_PP_CAT(trait,_detail_hsd) : \
0093 boost::mpl::eval_if \
0094 < \
0095 boost::is_class<BOOST_TTI_DETAIL_TP_T>, \
0096 BOOST_PP_CAT(trait,_detail_hsd_op)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_TYPE>, \
0097 boost::mpl::false_ \
0098 > \
0099 { \
0100 }; \
0101
0102
0103 #else
0104
0105 #define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \
0106 BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA_OP(trait,name) \
0107 template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_TYPE> \
0108 struct BOOST_PP_CAT(trait,_detail_hsd) : \
0109 boost::mpl::eval_if \
0110 < \
0111 BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
0112 BOOST_PP_CAT(trait,_detail_hsd_op)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_TYPE>, \
0113 boost::mpl::false_ \
0114 > \
0115 { \
0116 }; \
0117
0118
0119 #endif
0120
0121 #endif