]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | |
2 | #if !BOOST_PHOENIX_IS_ITERATING | |
3 | ||
4 | #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) | |
5 | ||
6 | #include <boost/phoenix/operator/detail/cpp03/preprocessed/mem_fun_ptr_gen.hpp> | |
7 | ||
8 | #else | |
9 | ||
10 | #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) | |
11 | #pragma wave option(preserve: 2, line: 0, output: "preprocessed/mem_fun_ptr_gen_" BOOST_PHOENIX_LIMIT_STR ".hpp") | |
12 | #endif | |
13 | ||
14 | /*============================================================================== | |
15 | Copyright (c) 2001-2010 Joel de Guzman | |
16 | Copyright (c) 2010 Thomas Heller | |
17 | ||
18 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
19 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
20 | ==============================================================================*/ | |
21 | ||
22 | #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) | |
23 | #pragma wave option(preserve: 1) | |
24 | #endif | |
25 | ||
26 | namespace detail { | |
27 | template <typename Object, typename MemPtr> | |
28 | struct mem_fun_ptr_gen | |
29 | { | |
30 | mem_fun_ptr_gen(Object const& obj_, MemPtr ptr_) | |
31 | : obj(obj_) | |
32 | , ptr(ptr_) | |
33 | {} | |
34 | ||
35 | typename phoenix::expression::mem_fun_ptr<Object, MemPtr>::type const | |
36 | operator()() const | |
37 | { | |
38 | return phoenix::expression::mem_fun_ptr<Object, MemPtr>::make(obj, ptr); | |
39 | } | |
40 | ||
41 | #define BOOST_PHOENIX_ITERATION_PARAMS \ | |
42 | (3, (1, BOOST_PHOENIX_MEMBER_LIMIT, \ | |
43 | <boost/phoenix/operator/detail/cpp03/mem_fun_ptr_gen.hpp>)) \ | |
44 | ||
45 | #include BOOST_PHOENIX_ITERATE() | |
46 | ||
47 | Object const& obj; | |
48 | MemPtr ptr; | |
49 | ||
50 | }; | |
51 | ||
52 | struct make_mem_fun_ptr_gen | |
53 | : proto::callable | |
54 | { | |
55 | template<typename Sig> | |
56 | struct result; | |
57 | ||
58 | template<typename This, typename Object, typename MemPtr> | |
59 | struct result<This(Object, MemPtr)> | |
60 | { | |
61 | typedef | |
62 | mem_fun_ptr_gen< | |
63 | typename remove_const<typename remove_reference<Object>::type>::type | |
64 | , typename remove_const<typename remove_reference<MemPtr>::type>::type | |
65 | > | |
66 | type; | |
67 | }; | |
68 | ||
69 | template<typename Object, typename MemPtr> | |
70 | mem_fun_ptr_gen<Object, MemPtr> operator()(Object const & obj, MemPtr ptr) const | |
71 | { | |
72 | return mem_fun_ptr_gen<Object, MemPtr>(obj, ptr); | |
73 | } | |
74 | }; | |
75 | } | |
76 | ||
77 | #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) | |
78 | #pragma wave option(output: null) | |
79 | #endif | |
80 | ||
81 | #endif // BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES | |
82 | ||
83 | #else | |
84 | template <BOOST_PHOENIX_typename_A> | |
85 | typename phoenix::expression::mem_fun_ptr< | |
86 | Object | |
87 | , MemPtr | |
88 | , BOOST_PHOENIX_A | |
89 | >::type const | |
90 | operator()(BOOST_PHOENIX_A_const_ref_a) const | |
91 | { | |
92 | return phoenix::expression::mem_fun_ptr< | |
93 | Object | |
94 | , MemPtr | |
95 | , BOOST_PHOENIX_A | |
96 | >::make(obj, ptr, BOOST_PHOENIX_a); | |
97 | } | |
98 | #endif |