Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/tti/detail/dmem_fun.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children | c530137014c0 |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 | |
2 // (C) Copyright Edward Diener 2011,2012,2013 | |
3 // Use, modification and distribution are subject to the Boost Software License, | |
4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | |
5 // http://www.boost.org/LICENSE_1_0.txt). | |
6 | |
7 #if !defined(BOOST_TTI_DETAIL_MEM_FUN_HPP) | |
8 #define BOOST_TTI_DETAIL_MEM_FUN_HPP | |
9 | |
10 #include <boost/config.hpp> | |
11 #include <boost/function_types/is_member_function_pointer.hpp> | |
12 #include <boost/function_types/property_tags.hpp> | |
13 #include <boost/mpl/and.hpp> | |
14 #include <boost/mpl/logical.hpp> | |
15 #include <boost/mpl/assert.hpp> | |
16 #include <boost/mpl/bool.hpp> | |
17 #include <boost/mpl/eval_if.hpp> | |
18 #include <boost/mpl/vector.hpp> | |
19 #include <boost/preprocessor/cat.hpp> | |
20 #include <boost/type_traits/detail/yes_no_type.hpp> | |
21 #include <boost/type_traits/is_same.hpp> | |
22 #include <boost/type_traits/remove_const.hpp> | |
23 #include <boost/tti/detail/dcomp_mem_fun.hpp> | |
24 #include <boost/tti/detail/ddeftype.hpp> | |
25 #include <boost/tti/detail/dnullptr.hpp> | |
26 #include <boost/tti/detail/dptmf.hpp> | |
27 #include <boost/tti/gen/namespace_gen.hpp> | |
28 | |
29 #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> \ | |
31 struct BOOST_PP_CAT(trait,_detail_types) \ | |
32 { \ | |
33 template<BOOST_TTI_DETAIL_TP_PMEMF> \ | |
34 struct helper; \ | |
35 \ | |
36 template<class BOOST_TTI_DETAIL_TP_EC> \ | |
37 static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_EC::name> *); \ | |
38 \ | |
39 template<class BOOST_TTI_DETAIL_TP_EC> \ | |
40 static ::boost::type_traits::no_type chkt(...); \ | |
41 \ | |
42 BOOST_STATIC_CONSTANT(bool,value=sizeof(chkt<BOOST_TTI_DETAIL_TP_C>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)); \ | |
43 \ | |
44 typedef boost::mpl::bool_<value> type; \ | |
45 }; \ | |
46 /**/ | |
47 | |
48 #define BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \ | |
49 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> \ | |
51 struct BOOST_PP_CAT(trait,_detail_call_types) : \ | |
52 BOOST_PP_CAT(trait,_detail_types) \ | |
53 < \ | |
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, \ | |
55 BOOST_TTI_DETAIL_TP_T \ | |
56 > \ | |
57 { \ | |
58 }; \ | |
59 /**/ | |
60 | |
61 #define BOOST_TTI_DETAIL_TRAIT_CHECK_HAS_COMP_MEMBER_FUNCTION(trait,name) \ | |
62 BOOST_TTI_DETAIL_TRAIT_HAS_COMP_MEMBER_FUNCTION(trait,name) \ | |
63 template<class BOOST_TTI_DETAIL_TP_T> \ | |
64 struct BOOST_PP_CAT(trait,_detail_check_comp) : \ | |
65 BOOST_PP_CAT(trait,_detail_hcmf)<BOOST_TTI_DETAIL_TP_T> \ | |
66 { \ | |
67 BOOST_MPL_ASSERT((boost::function_types::is_member_function_pointer<BOOST_TTI_DETAIL_TP_T>)); \ | |
68 }; \ | |
69 /**/ | |
70 | |
71 #define BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_FUNCTION(trait,name) \ | |
72 BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \ | |
73 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> \ | |
75 struct BOOST_PP_CAT(trait,_detail_hmf) \ | |
76 { \ | |
77 typedef typename \ | |
78 boost::mpl::eval_if \ | |
79 < \ | |
80 boost::mpl::and_ \ | |
81 < \ | |
82 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<> >, \ | |
84 boost::is_same<BOOST_TTI_DETAIL_TP_TAG,boost::function_types::null_tag> \ | |
85 >, \ | |
86 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> \ | |
88 >::type type; \ | |
89 \ | |
90 BOOST_STATIC_CONSTANT(bool,value=type::value); \ | |
91 }; \ | |
92 /**/ | |
93 | |
94 #endif // BOOST_TTI_DETAIL_MEM_FUN_HPP |