// (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_MEM_FUN_HPP) #define BOOST_TTI_DETAIL_MEM_FUN_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(__SUNPRO_CC) #define BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \ template \ struct BOOST_PP_CAT(trait,_detail_types) \ { \ template \ struct helper {}; \ \ template \ static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_EC::name> *); \ \ template \ static ::boost::type_traits::no_type chkt(...); \ \ typedef boost::mpl::bool_(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)> type; \ }; \ /**/ #else #define BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \ template \ struct BOOST_PP_CAT(trait,_detail_types) \ { \ template \ struct helper; \ \ template \ static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_EC::name> *); \ \ template \ static ::boost::type_traits::no_type chkt(...); \ \ typedef boost::mpl::bool_(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)> type; \ }; \ /**/ #endif #define BOOST_TTI_DETAIL_TRAIT_CTMF_INVOKE(trait,name) \ BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \ template \ struct BOOST_PP_CAT(trait,_detail_ctmf_invoke) : \ BOOST_PP_CAT(trait,_detail_types) \ < \ typename BOOST_TTI_NAMESPACE::detail::ptmf_seq::type, \ BOOST_TTI_DETAIL_TP_T \ > \ { \ }; \ /**/ #define BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \ BOOST_TTI_DETAIL_TRAIT_CTMF_INVOKE(trait,name) \ template \ struct BOOST_PP_CAT(trait,_detail_call_types) : \ boost::mpl::eval_if \ < \ boost::is_class, \ BOOST_PP_CAT(trait,_detail_ctmf_invoke) \ < \ BOOST_TTI_DETAIL_TP_T, \ BOOST_TTI_DETAIL_TP_R, \ BOOST_TTI_DETAIL_TP_FS, \ BOOST_TTI_DETAIL_TP_TAG \ >, \ boost::mpl::false_ \ > \ { \ }; \ /**/ #define BOOST_TTI_DETAIL_TRAIT_CHECK_HAS_COMP_MEMBER_FUNCTION(trait,name) \ BOOST_TTI_DETAIL_TRAIT_HAS_COMP_MEMBER_FUNCTION(trait,name) \ template \ struct BOOST_PP_CAT(trait,_detail_check_comp) : \ BOOST_PP_CAT(trait,_detail_hcmf) \ { \ BOOST_MPL_ASSERT((boost::function_types::is_member_function_pointer)); \ }; \ /**/ #define BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_FUNCTION(trait,name) \ BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \ BOOST_TTI_DETAIL_TRAIT_CHECK_HAS_COMP_MEMBER_FUNCTION(trait,name) \ template \ struct BOOST_PP_CAT(trait,_detail_hmf) : \ boost::mpl::eval_if \ < \ boost::mpl::and_ \ < \ boost::is_same, \ boost::is_same >, \ boost::is_same \ >, \ BOOST_PP_CAT(trait,_detail_check_comp), \ BOOST_PP_CAT(trait,_detail_call_types) \ > \ { \ }; \ /**/ #endif // BOOST_TTI_DETAIL_MEM_FUN_HPP