source: NonGTP/Boost/boost/utility/detail/result_of_iterate.hpp @ 857

Revision 857, 2.8 KB checked in by igarcia, 19 years ago (diff)
Line 
1// Boost result_of library
2
3//  Copyright Douglas Gregor 2004. Use, modification and
4//  distribution is subject to the Boost Software License, Version
5//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
6//  http://www.boost.org/LICENSE_1_0.txt)
7
8// For more information, see http://www.boost.org/libs/utility
9#if !defined(BOOST_PP_IS_ITERATING)
10# error Boost result_of - do not include this file!
11#endif
12
13// CWPro8 requires an argument in a function type specialization
14#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3002)) && BOOST_PP_ITERATION() == 0
15# define BOOST_RESULT_OF_ARGS void
16#else
17# define BOOST_RESULT_OF_ARGS BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)
18#endif
19
20#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
21template<typename F BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
22         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
23struct result_of<F(BOOST_RESULT_OF_ARGS)>
24    : detail::result_of<F, F(BOOST_RESULT_OF_ARGS)> {};
25#endif
26
27namespace detail {
28
29template<typename R,  typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
30         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
31struct result_of<R (*)(BOOST_RESULT_OF_ARGS), FArgs>
32{
33  typedef R type;
34};
35
36template<typename R,  typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
37         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
38struct result_of<R (&)(BOOST_RESULT_OF_ARGS), FArgs>
39{
40  typedef R type;
41};
42
43#undef BOOST_RESULT_OF_ARGS
44
45#if BOOST_PP_ITERATION() > 1 && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
46template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
47         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
48struct result_of<R (T0::*)
49                     (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T)),
50                 FArgs>
51{
52  typedef R type;
53};
54
55template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
56         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
57struct result_of<R (T0::*)
58                     (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
59                     const,
60                 FArgs>
61{
62  typedef R type;
63};
64
65template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
66         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
67struct result_of<R (T0::*)
68                     (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
69                     volatile,
70                 FArgs>
71{
72  typedef R type;
73};
74
75template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
76         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
77struct result_of<R (T0::*)
78                     (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
79                     const volatile,
80                 FArgs>
81{
82  typedef R type;
83};
84#endif
85
86}
Note: See TracBrowser for help on using the repository browser.