]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2011 Joel de Guzman | |
3 | ||
4 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | ==============================================================================*/ | |
7 | #if !defined(FUSION_REVERSE_07212005_1230) | |
8 | #define FUSION_REVERSE_07212005_1230 | |
9 | ||
10 | #include <boost/fusion/support/config.hpp> | |
11 | #include <boost/fusion/view/reverse_view/reverse_view.hpp> | |
12 | #include <boost/fusion/support/is_sequence.hpp> | |
13 | #include <boost/utility/enable_if.hpp> | |
14 | ||
15 | namespace boost { namespace fusion | |
16 | { | |
17 | namespace result_of | |
18 | { | |
19 | template <typename Sequence> | |
20 | struct reverse | |
21 | { | |
22 | typedef reverse_view<Sequence> type; | |
23 | }; | |
24 | } | |
25 | ||
26 | template <typename Sequence> | |
27 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
28 | inline typename | |
29 | enable_if< | |
30 | traits::is_sequence<Sequence> | |
31 | , reverse_view<Sequence const> | |
32 | >::type | |
33 | reverse(Sequence const& view) | |
34 | { | |
35 | return reverse_view<Sequence const>(view); | |
36 | } | |
37 | }} | |
38 | ||
39 | #endif | |
40 |