// (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 ::lslboost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_EC::name> *); \ \ template \ static ::lslboost::type_traits::no_type chkt(...); \ \ typedef lslboost::mpl::bool_(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::lslboost::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 ::lslboost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_EC::name> *); \ \ template \ static ::lslboost::type_traits::no_type chkt(...); \ \ typedef lslboost::mpl::bool_(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::lslboost::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) : \ lslboost::mpl::eval_if \ < \ lslboost::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 \ >, \ lslboost::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((lslboost::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) : \ lslboost::mpl::eval_if \ < \ lslboost::mpl::and_ \ < \ lslboost::is_same, \ lslboost::is_same >, \ lslboost::is_same \ >, \ BOOST_PP_CAT(trait,_detail_check_comp), \ BOOST_PP_CAT(trait,_detail_call_types) \ > \ { \ }; \ /**/ #endif // BOOST_TTI_DETAIL_MEM_FUN_HPP