]>
Commit | Line | Data |
---|---|---|
1 | #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES) | |
2 | ||
3 | #include <boost/proto/detail/preprocessed/funop.hpp> | |
4 | ||
5 | #elif !defined(BOOST_PP_IS_ITERATING) | |
6 | ||
7 | #define BOOST_PROTO_AS_CHILD_TYPE(Z, N, DATA) \ | |
8 | typename proto::result_of::as_child<BOOST_PP_CAT(A, N), Domain>::type \ | |
9 | /**/ | |
10 | ||
11 | #define BOOST_PROTO_AS_CHILD(Z, N, DATA) \ | |
12 | proto::as_child<Domain>(BOOST_PP_CAT(a, N)) \ | |
13 | /**/ | |
14 | ||
15 | #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) | |
16 | #pragma wave option(preserve: 2, line: 0, output: "preprocessed/funop.hpp") | |
17 | #endif | |
18 | ||
19 | /////////////////////////////////////////////////////////////////////////////// | |
20 | // funop.hpp | |
21 | // Contains definition of funop[n]\<\> class template. | |
22 | // | |
23 | // Copyright 2008 Eric Niebler. Distributed under the Boost | |
24 | // Software License, Version 1.0. (See accompanying file | |
25 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
26 | ||
27 | #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) | |
28 | #pragma wave option(preserve: 1) | |
29 | #endif | |
30 | ||
31 | #define BOOST_PP_ITERATION_PARAMS_1 \ | |
32 | (3, (0, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY), <boost/proto/detail/funop.hpp>)) | |
33 | #include BOOST_PP_ITERATE() | |
34 | ||
35 | #undef BOOST_PROTO_AS_CHILD | |
36 | #undef BOOST_PROTO_AS_CHILD_TYPE | |
37 | ||
38 | #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) | |
39 | #pragma wave option(output: null) | |
40 | #endif | |
41 | ||
42 | #else | |
43 | ||
44 | /// \brief A helper metafunction for computing the | |
45 | /// return type of \c proto::expr\<\>::operator(). | |
46 | template<typename Expr, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename A)> | |
47 | struct BOOST_PP_CAT(funop, BOOST_PP_ITERATION()) | |
48 | { | |
49 | typedef typename proto::base_expr< | |
50 | Domain | |
51 | , tag::function | |
52 | , BOOST_PP_CAT(list, BOOST_PP_INC(BOOST_PP_ITERATION()))< | |
53 | Expr & | |
54 | BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), BOOST_PROTO_AS_CHILD_TYPE, ~) | |
55 | > | |
56 | >::type type; | |
57 | ||
58 | BOOST_FORCEINLINE | |
59 | static type const call( | |
60 | Expr &e | |
61 | BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(BOOST_PP_ITERATION(), A, &a) | |
62 | ) | |
63 | { | |
64 | type that = { | |
65 | e | |
66 | BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), BOOST_PROTO_AS_CHILD, ~) | |
67 | }; | |
68 | return that; | |
69 | } | |
70 | }; | |
71 | ||
72 | /// \brief A helper metafunction for computing the | |
73 | /// return type of \c proto::expr\<\>::operator(). | |
74 | template<typename Expr BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename A), typename This, typename Domain> | |
75 | struct funop<Expr(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), A)), This, Domain> | |
76 | : BOOST_PP_CAT(funop, BOOST_PP_ITERATION())< | |
77 | typename detail::same_cv<Expr, This>::type | |
78 | , Domain | |
79 | BOOST_PP_ENUM_TRAILING_BINARY_PARAMS( | |
80 | BOOST_PP_ITERATION() | |
81 | , typename remove_reference<A | |
82 | , >::type BOOST_PP_INTERCEPT | |
83 | ) | |
84 | > | |
85 | {}; | |
86 | ||
87 | #endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES |