// (C) Copyright Edward Diener 2011,2012,2013 // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). #if !defined(BOOST_TTI_DETAIL_STATIC_MEM_DATA_HPP) #define BOOST_TTI_DETAIL_STATIC_MEM_DATA_HPP #include #include #include #include #include #include #include #include #include #include #include #if defined(BOOST_MSVC) #define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA_OP(trait,name) \ template \ struct BOOST_PP_CAT(trait,_detail_hsd_op) \ { \ template \ struct menable_if; \ \ template \ struct menable_if \ { \ typedef BOOST_TTI_DETAIL_TP_U type; \ }; \ \ template \ static ::boost::type_traits::yes_type check2(BOOST_TTI_DETAIL_TP_V *); \ \ template \ static ::boost::type_traits::no_type check2(BOOST_TTI_DETAIL_TP_U); \ \ template \ static typename \ menable_if \ < \ sizeof(check2(&BOOST_TTI_DETAIL_TP_U::name))==sizeof(::boost::type_traits::yes_type), \ ::boost::type_traits::yes_type \ > \ ::type \ has_matching_member(int); \ \ template \ static ::boost::type_traits::no_type has_matching_member(...); \ \ template \ struct ttc_sd \ { \ typedef boost::mpl::bool_(0))==sizeof(::boost::type_traits::yes_type)> type; \ }; \ \ typedef typename ttc_sd::type type; \ }; \ /**/ #else #define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA_OP(trait,name) \ template \ struct BOOST_PP_CAT(trait,_detail_hsd_op) \ { \ template \ struct helper BOOST_TTI_DETAIL_MACRO_SUNFIX ; \ \ template \ static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_U::name> *); \ \ template \ static ::boost::type_traits::no_type chkt(...); \ \ typedef boost::mpl::bool_<(!boost::function_types::is_function::value) && (sizeof(chkt(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type))> type; \ }; \ /**/ #endif // defined(BOOST_MSVC) #if defined(BOOST_NO_CXX11_UNRESTRICTED_UNION) #define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \ BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA_OP(trait,name) \ template \ struct BOOST_PP_CAT(trait,_detail_hsd) : \ boost::mpl::eval_if \ < \ boost::is_class, \ BOOST_PP_CAT(trait,_detail_hsd_op), \ boost::mpl::false_ \ > \ { \ }; \ /**/ #else #define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \ BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA_OP(trait,name) \ template \ struct BOOST_PP_CAT(trait,_detail_hsd) : \ boost::mpl::eval_if \ < \ BOOST_TTI_NAMESPACE::detail::enclosing_type, \ BOOST_PP_CAT(trait,_detail_hsd_op), \ boost::mpl::false_ \ > \ { \ }; \ /**/ #endif #endif // BOOST_TTI_DETAIL_STATIC_MEM_DATA_HPP