comparison DEPENDENCIES/generic/include/boost/tti/detail/dmem_fun.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
16 #include <boost/mpl/bool.hpp> 16 #include <boost/mpl/bool.hpp>
17 #include <boost/mpl/eval_if.hpp> 17 #include <boost/mpl/eval_if.hpp>
18 #include <boost/mpl/vector.hpp> 18 #include <boost/mpl/vector.hpp>
19 #include <boost/preprocessor/cat.hpp> 19 #include <boost/preprocessor/cat.hpp>
20 #include <boost/type_traits/detail/yes_no_type.hpp> 20 #include <boost/type_traits/detail/yes_no_type.hpp>
21 #include <boost/type_traits/is_class.hpp>
21 #include <boost/type_traits/is_same.hpp> 22 #include <boost/type_traits/is_same.hpp>
22 #include <boost/type_traits/remove_const.hpp> 23 #include <boost/type_traits/remove_const.hpp>
23 #include <boost/tti/detail/dcomp_mem_fun.hpp> 24 #include <boost/tti/detail/dcomp_mem_fun.hpp>
24 #include <boost/tti/detail/ddeftype.hpp> 25 #include <boost/tti/detail/ddeftype.hpp>
25 #include <boost/tti/detail/dnullptr.hpp> 26 #include <boost/tti/detail/dnullptr.hpp>
26 #include <boost/tti/detail/dptmf.hpp> 27 #include <boost/tti/detail/dptmf.hpp>
27 #include <boost/tti/gen/namespace_gen.hpp> 28 #include <boost/tti/gen/namespace_gen.hpp>
29
30 #if defined(__SUNPRO_CC)
31
32 #define BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \
33 template<class BOOST_TTI_DETAIL_TP_PMEMF,class BOOST_TTI_DETAIL_TP_C> \
34 struct BOOST_PP_CAT(trait,_detail_types) \
35 { \
36 template<BOOST_TTI_DETAIL_TP_PMEMF> \
37 struct helper {}; \
38 \
39 template<class BOOST_TTI_DETAIL_TP_EC> \
40 static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_EC::name> *); \
41 \
42 template<class BOOST_TTI_DETAIL_TP_EC> \
43 static ::boost::type_traits::no_type chkt(...); \
44 \
45 typedef boost::mpl::bool_<sizeof(chkt<BOOST_TTI_DETAIL_TP_C>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)> type; \
46 }; \
47 /**/
48
49 #else
28 50
29 #define BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \ 51 #define BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \
30 template<class BOOST_TTI_DETAIL_TP_PMEMF,class BOOST_TTI_DETAIL_TP_C> \ 52 template<class BOOST_TTI_DETAIL_TP_PMEMF,class BOOST_TTI_DETAIL_TP_C> \
31 struct BOOST_PP_CAT(trait,_detail_types) \ 53 struct BOOST_PP_CAT(trait,_detail_types) \
32 { \ 54 { \
37 static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_EC::name> *); \ 59 static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_EC::name> *); \
38 \ 60 \
39 template<class BOOST_TTI_DETAIL_TP_EC> \ 61 template<class BOOST_TTI_DETAIL_TP_EC> \
40 static ::boost::type_traits::no_type chkt(...); \ 62 static ::boost::type_traits::no_type chkt(...); \
41 \ 63 \
42 BOOST_STATIC_CONSTANT(bool,value=sizeof(chkt<BOOST_TTI_DETAIL_TP_C>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)); \ 64 typedef boost::mpl::bool_<sizeof(chkt<BOOST_TTI_DETAIL_TP_C>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)> type; \
43 \
44 typedef boost::mpl::bool_<value> type; \
45 }; \ 65 }; \
46 /**/ 66 /**/
47 67
48 #define BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \ 68 #endif
69
70 #define BOOST_TTI_DETAIL_TRAIT_CTMF_INVOKE(trait,name) \
49 BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \ 71 BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \
50 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> \ 72 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> \
51 struct BOOST_PP_CAT(trait,_detail_call_types) : \ 73 struct BOOST_PP_CAT(trait,_detail_ctmf_invoke) : \
52 BOOST_PP_CAT(trait,_detail_types) \ 74 BOOST_PP_CAT(trait,_detail_types) \
53 < \ 75 < \
54 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, \ 76 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, \
55 BOOST_TTI_DETAIL_TP_T \ 77 BOOST_TTI_DETAIL_TP_T \
56 > \ 78 > \
79 { \
80 }; \
81 /**/
82
83 #define BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \
84 BOOST_TTI_DETAIL_TRAIT_CTMF_INVOKE(trait,name) \
85 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> \
86 struct BOOST_PP_CAT(trait,_detail_call_types) : \
87 boost::mpl::eval_if \
88 < \
89 boost::is_class<BOOST_TTI_DETAIL_TP_T>, \
90 BOOST_PP_CAT(trait,_detail_ctmf_invoke) \
91 < \
92 BOOST_TTI_DETAIL_TP_T, \
93 BOOST_TTI_DETAIL_TP_R, \
94 BOOST_TTI_DETAIL_TP_FS, \
95 BOOST_TTI_DETAIL_TP_TAG \
96 >, \
97 boost::mpl::false_ \
98 > \
57 { \ 99 { \
58 }; \ 100 }; \
59 /**/ 101 /**/
60 102
61 #define BOOST_TTI_DETAIL_TRAIT_CHECK_HAS_COMP_MEMBER_FUNCTION(trait,name) \ 103 #define BOOST_TTI_DETAIL_TRAIT_CHECK_HAS_COMP_MEMBER_FUNCTION(trait,name) \
70 112
71 #define BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_FUNCTION(trait,name) \ 113 #define BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_FUNCTION(trait,name) \
72 BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \ 114 BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \
73 BOOST_TTI_DETAIL_TRAIT_CHECK_HAS_COMP_MEMBER_FUNCTION(trait,name) \ 115 BOOST_TTI_DETAIL_TRAIT_CHECK_HAS_COMP_MEMBER_FUNCTION(trait,name) \
74 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> \ 116 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> \
75 struct BOOST_PP_CAT(trait,_detail_hmf) \ 117 struct BOOST_PP_CAT(trait,_detail_hmf) : \
76 { \
77 typedef typename \
78 boost::mpl::eval_if \ 118 boost::mpl::eval_if \
79 < \ 119 < \
80 boost::mpl::and_ \ 120 boost::mpl::and_ \
81 < \ 121 < \
82 boost::is_same<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_NAMESPACE::detail::deftype>, \ 122 boost::is_same<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_NAMESPACE::detail::deftype>, \
83 boost::is_same<BOOST_TTI_DETAIL_TP_FS,boost::mpl::vector<> >, \ 123 boost::is_same<BOOST_TTI_DETAIL_TP_FS,boost::mpl::vector<> >, \
84 boost::is_same<BOOST_TTI_DETAIL_TP_TAG,boost::function_types::null_tag> \ 124 boost::is_same<BOOST_TTI_DETAIL_TP_TAG,boost::function_types::null_tag> \
85 >, \ 125 >, \
86 BOOST_PP_CAT(trait,_detail_check_comp)<BOOST_TTI_DETAIL_TP_T>, \ 126 BOOST_PP_CAT(trait,_detail_check_comp)<BOOST_TTI_DETAIL_TP_T>, \
87 BOOST_PP_CAT(trait,_detail_call_types)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG> \ 127 BOOST_PP_CAT(trait,_detail_call_types)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG> \
88 >::type type; \ 128 > \
89 \ 129 { \
90 BOOST_STATIC_CONSTANT(bool,value=type::value); \
91 }; \ 130 }; \
92 /**/ 131 /**/
93 132
94 #endif // BOOST_TTI_DETAIL_MEM_FUN_HPP 133 #endif // BOOST_TTI_DETAIL_MEM_FUN_HPP