Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:52:54

0001 
0002 //  (C) Copyright Edward Diener 2011,2012,2013
0003 //  Use, modification and distribution are subject to the Boost Software License,
0004 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 //  http://www.boost.org/LICENSE_1_0.txt).
0006 
0007 #if !defined(BOOST_TTI_DETAIL_MEM_FUN_HPP)
0008 #define BOOST_TTI_DETAIL_MEM_FUN_HPP
0009 
0010 #include <boost/function_types/is_member_function_pointer.hpp>
0011 #include <boost/function_types/property_tags.hpp>
0012 #include <boost/mpl/and.hpp>
0013 #include <boost/mpl/logical.hpp>
0014 #include <boost/mpl/assert.hpp>
0015 #include <boost/mpl/bool.hpp>
0016 #include <boost/mpl/eval_if.hpp>
0017 #include <boost/mpl/vector.hpp>
0018 #include <boost/preprocessor/cat.hpp>
0019 #include <boost/type_traits/detail/yes_no_type.hpp>
0020 #include <boost/type_traits/is_same.hpp>
0021 #include <boost/type_traits/remove_const.hpp>
0022 #include <boost/tti/detail/dcomp_mem_fun.hpp>
0023 #include <boost/tti/detail/ddeftype.hpp>
0024 #include <boost/tti/detail/dmacro_sunfix.hpp>
0025 #include <boost/tti/detail/dnullptr.hpp>
0026 #include <boost/tti/detail/denclosing_type.hpp>
0027 #include <boost/tti/detail/dptmf.hpp>
0028 #include <boost/tti/gen/namespace_gen.hpp>
0029 
0030 #define BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \
0031   template<class BOOST_TTI_DETAIL_TP_PMEMF,class BOOST_TTI_DETAIL_TP_C> \
0032   struct BOOST_PP_CAT(trait,_detail_hmf_types) \
0033     { \
0034     template<BOOST_TTI_DETAIL_TP_PMEMF> \
0035     struct helper BOOST_TTI_DETAIL_MACRO_SUNFIX ; \
0036     \
0037     template<class BOOST_TTI_DETAIL_TP_EC> \
0038     static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_EC::name> *); \
0039     \
0040     template<class BOOST_TTI_DETAIL_TP_EC> \
0041     static ::boost::type_traits::no_type chkt(...); \
0042     \
0043     typedef boost::mpl::bool_<sizeof(chkt<BOOST_TTI_DETAIL_TP_C>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)> type; \
0044     }; \
0045 /**/
0046 
0047 #define BOOST_TTI_DETAIL_TRAIT_CTMF_INVOKE(trait,name) \
0048   BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \
0049   template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
0050   struct BOOST_PP_CAT(trait,_detail_hmf_ctmf_invoke) : \
0051     BOOST_PP_CAT(trait,_detail_hmf_types) \
0052       < \
0053       typename BOOST_TTI_NAMESPACE::detail::ptmf_seq<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>::type, \
0054       BOOST_TTI_DETAIL_TP_T \
0055       > \
0056     { \
0057     }; \
0058 /**/
0059 
0060 #define BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \
0061   BOOST_TTI_DETAIL_TRAIT_CTMF_INVOKE(trait,name) \
0062   template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
0063   struct BOOST_PP_CAT(trait,_detail_hmf_call_types) : \
0064     boost::mpl::eval_if \
0065         < \
0066         BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
0067         BOOST_PP_CAT(trait,_detail_hmf_ctmf_invoke) \
0068             < \
0069             BOOST_TTI_DETAIL_TP_T, \
0070             BOOST_TTI_DETAIL_TP_R, \
0071             BOOST_TTI_DETAIL_TP_FS, \
0072             BOOST_TTI_DETAIL_TP_TAG \
0073             >, \
0074         boost::mpl::false_ \
0075         > \
0076     { \
0077     }; \
0078 /**/
0079 
0080 #define BOOST_TTI_DETAIL_TRAIT_CHECK_HAS_COMP_MEMBER_FUNCTION(trait,name) \
0081   BOOST_TTI_DETAIL_TRAIT_HAS_COMP_MEMBER_FUNCTION(trait,name) \
0082   template<class BOOST_TTI_DETAIL_TP_T> \
0083   struct BOOST_PP_CAT(trait,_detail_hmf_check_comp) : \
0084     BOOST_PP_CAT(trait,_detail_hcmf)<BOOST_TTI_DETAIL_TP_T> \
0085     { \
0086     BOOST_MPL_ASSERT((boost::function_types::is_member_function_pointer<BOOST_TTI_DETAIL_TP_T>)); \
0087     }; \
0088 /**/
0089 
0090 #define BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_FUNCTION(trait,name) \
0091   BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \
0092   BOOST_TTI_DETAIL_TRAIT_CHECK_HAS_COMP_MEMBER_FUNCTION(trait,name) \
0093   template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
0094   struct BOOST_PP_CAT(trait,_detail_hmf) : \
0095     boost::mpl::eval_if \
0096       < \
0097       boost::mpl::and_ \
0098         < \
0099         boost::is_same<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_NAMESPACE::detail::deftype>, \
0100         boost::is_same<BOOST_TTI_DETAIL_TP_FS,boost::mpl::vector<> >, \
0101         boost::is_same<BOOST_TTI_DETAIL_TP_TAG,boost::function_types::null_tag> \
0102         >, \
0103       BOOST_PP_CAT(trait,_detail_hmf_check_comp)<BOOST_TTI_DETAIL_TP_T>, \
0104       BOOST_PP_CAT(trait,_detail_hmf_call_types)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG> \
0105       > \
0106     { \
0107     }; \
0108 /**/
0109 
0110 #endif // BOOST_TTI_DETAIL_MEM_FUN_HPP