Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/phoenix/operator/member.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 | |
2 #if !BOOST_PHOENIX_IS_ITERATING | |
3 | |
4 #ifndef BOOST_PHOENIX_OPERATOR_MEMBER_HPP | |
5 #define BOOST_PHOENIX_OPERATOR_MEMBER_HPP | |
6 | |
7 #include <boost/phoenix/core/limits.hpp> | |
8 #include <boost/get_pointer.hpp> | |
9 #include <boost/phoenix/core/domain.hpp> | |
10 #include <boost/phoenix/core/meta_grammar.hpp> | |
11 #include <boost/phoenix/core/call.hpp> | |
12 #include <boost/phoenix/operator/detail/mem_fun_ptr_gen.hpp> | |
13 #include <boost/phoenix/support/iterate.hpp> | |
14 #include <boost/type_traits/remove_reference.hpp> | |
15 #include <boost/type_traits/is_member_function_pointer.hpp> | |
16 #include <boost/proto/operators.hpp> | |
17 | |
18 #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) | |
19 | |
20 #include <boost/phoenix/operator/preprocessed/member.hpp> | |
21 | |
22 #else | |
23 | |
24 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) | |
25 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/member_" BOOST_PHOENIX_LIMIT_STR ".hpp") | |
26 #endif | |
27 | |
28 /*============================================================================== | |
29 Copyright (c) 2005-2010 Joel de Guzman | |
30 Copyright (c) 2010 Thomas Heller | |
31 | |
32 Distributed under the Boost Software License, Version 1.0. (See accompanying | |
33 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
34 ==============================================================================*/ | |
35 | |
36 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) | |
37 #pragma wave option(preserve: 1) | |
38 #endif | |
39 | |
40 #include <boost/phoenix/operator/detail/define_operator.hpp> | |
41 | |
42 namespace boost { namespace phoenix | |
43 { | |
44 BOOST_PHOENIX_BINARY_OPERATORS((mem_ptr)) | |
45 | |
46 template<> | |
47 struct phoenix_generator::case_<proto::tag::mem_ptr> | |
48 : proto::or_< | |
49 proto::when< | |
50 proto::and_< | |
51 proto::mem_ptr<meta_grammar, proto::terminal<proto::_> > | |
52 , proto::if_<is_member_function_pointer<boost::remove_reference<proto::call<proto::_value(proto::_right)> > >()> | |
53 > | |
54 , proto::call<detail::make_mem_fun_ptr_gen(proto::_left, proto::call<proto::_value(proto::_right)>)> | |
55 > | |
56 , proto::otherwise< | |
57 proto::call<proto::pod_generator<actor>(proto::_)> | |
58 > | |
59 > | |
60 {}; | |
61 | |
62 namespace result_of | |
63 { | |
64 template < | |
65 typename Context | |
66 , BOOST_PHOENIX_typename_A_void(BOOST_PHOENIX_LIMIT) | |
67 , typename Dummy = void | |
68 > | |
69 struct mem_fun_ptr_eval; | |
70 | |
71 #include <boost/phoenix/operator/detail/mem_fun_ptr_eval_result_of.hpp> | |
72 } | |
73 | |
74 struct mem_fun_ptr_eval | |
75 { | |
76 template<typename Sig> | |
77 struct result; | |
78 | |
79 #define BOOST_PHOENIX_MEMBER_EVAL(Z, N, D) \ | |
80 BOOST_PP_COMMA_IF(BOOST_PP_NOT(BOOST_PP_EQUAL(N, 2))) \ | |
81 boost::phoenix::eval(BOOST_PP_CAT(a, N), ctx) \ | |
82 /**/ | |
83 | |
84 #define BOOST_PHOENIX_ITERATION_PARAMS \ | |
85 (3, (2, BOOST_PHOENIX_LIMIT, \ | |
86 <boost/phoenix/operator/member.hpp>)) \ | |
87 /**/ | |
88 #include BOOST_PHOENIX_ITERATE() | |
89 #undef BOOST_PHOENIX_MEMBER_EVAL | |
90 }; | |
91 | |
92 template <typename Dummy> | |
93 struct default_actions::when<rule::mem_fun_ptr, Dummy> | |
94 : call<mem_fun_ptr_eval> | |
95 {}; | |
96 }} | |
97 | |
98 #include <boost/phoenix/operator/detail/undef_operator.hpp> | |
99 | |
100 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) | |
101 #pragma wave option(output: null) | |
102 #endif | |
103 | |
104 #endif // BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES | |
105 | |
106 #endif | |
107 | |
108 #else // BOOST_PHOENIX_IS_ITERATING | |
109 | |
110 template <typename This, BOOST_PHOENIX_typename_A, typename Context> | |
111 struct result<This(BOOST_PHOENIX_A, Context)> | |
112 : result<This(BOOST_PHOENIX_A_const_ref, Context)> | |
113 {}; | |
114 | |
115 template <typename This, BOOST_PHOENIX_typename_A, typename Context> | |
116 struct result<This(BOOST_PHOENIX_A_ref, Context)> | |
117 : result_of::mem_fun_ptr_eval<Context, BOOST_PHOENIX_A> | |
118 {}; | |
119 | |
120 template <BOOST_PHOENIX_typename_A, typename Context> | |
121 typename result_of::mem_fun_ptr_eval<Context, BOOST_PHOENIX_A>::type | |
122 operator()( | |
123 BOOST_PHOENIX_A_const_ref_a | |
124 , Context const & ctx | |
125 ) const | |
126 { | |
127 return | |
128 ( | |
129 get_pointer(boost::phoenix::eval(a0, ctx)) | |
130 ->*boost::phoenix::eval(a1, ctx) | |
131 )( | |
132 BOOST_PP_REPEAT_FROM_TO( | |
133 2 | |
134 , BOOST_PHOENIX_ITERATION | |
135 , BOOST_PHOENIX_MEMBER_EVAL | |
136 , BOOST_PHOENIX_ITERATION | |
137 ) | |
138 ); | |
139 } | |
140 | |
141 | |
142 #endif |