Chris@16
|
1 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
|
Chris@16
|
2
|
Chris@16
|
3 #include <boost/proto/detail/preprocessed/poly_function_traits.hpp>
|
Chris@16
|
4
|
Chris@16
|
5 #elif !defined(BOOST_PP_IS_ITERATING)
|
Chris@16
|
6
|
Chris@16
|
7 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
8 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/poly_function_traits.hpp")
|
Chris@16
|
9 #endif
|
Chris@16
|
10
|
Chris@16
|
11 ///////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
12 // poly_function_traits.hpp
|
Chris@16
|
13 // Contains specializations of poly_function_traits and as_mono_function
|
Chris@16
|
14 //
|
Chris@16
|
15 // Copyright 2008 Eric Niebler. Distributed under the Boost
|
Chris@16
|
16 // Software License, Version 1.0. (See accompanying file
|
Chris@16
|
17 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
18
|
Chris@16
|
19 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
20 #pragma wave option(preserve: 1)
|
Chris@16
|
21 #endif
|
Chris@16
|
22
|
Chris@16
|
23 #define BOOST_PP_ITERATION_PARAMS_1 \
|
Chris@16
|
24 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/poly_function_traits.hpp>))
|
Chris@16
|
25 #include BOOST_PP_ITERATE()
|
Chris@16
|
26
|
Chris@16
|
27 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
28 #pragma wave option(output: null)
|
Chris@16
|
29 #endif
|
Chris@16
|
30
|
Chris@16
|
31 #else
|
Chris@16
|
32
|
Chris@16
|
33 #define N BOOST_PP_ITERATION()
|
Chris@16
|
34
|
Chris@16
|
35 ////////////////////////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
36 template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
|
Chris@16
|
37 struct poly_function_traits<PolyFun, PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), mpl::size_t<sizeof(poly_function_t)> >
|
Chris@16
|
38 {
|
Chris@16
|
39 typedef typename PolyFun::template impl<BOOST_PP_ENUM_PARAMS(N, const A)> function_type;
|
Chris@16
|
40 typedef typename function_type::result_type result_type;
|
Chris@16
|
41 };
|
Chris@16
|
42
|
Chris@16
|
43 ////////////////////////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
44 template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
|
Chris@16
|
45 struct as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), true>
|
Chris@16
|
46 {
|
Chris@16
|
47 typedef typename PolyFun::template impl<BOOST_PP_ENUM_PARAMS(N, const A)> type;
|
Chris@16
|
48 };
|
Chris@16
|
49
|
Chris@16
|
50 ////////////////////////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
51 template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
|
Chris@16
|
52 struct as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), false>
|
Chris@16
|
53 {
|
Chris@16
|
54 typedef PolyFun type;
|
Chris@16
|
55 };
|
Chris@16
|
56
|
Chris@16
|
57 ////////////////////////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
58 template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
|
Chris@16
|
59 struct as_mono_function<PolyFun(BOOST_PP_ENUM_PARAMS(N, A))>
|
Chris@16
|
60 : as_mono_function_impl<PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), is_poly_function<PolyFun>::value>
|
Chris@16
|
61 {};
|
Chris@16
|
62
|
Chris@16
|
63 #undef N
|
Chris@16
|
64
|
Chris@16
|
65 #endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES
|