]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2009 Christopher Schmidt | |
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 | ||
8 | #ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_AT_IMPL_HPP | |
9 | #define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_AT_IMPL_HPP | |
10 | ||
11 | #include <boost/fusion/support/config.hpp> | |
12 | #include <boost/fusion/sequence/intrinsic/at.hpp> | |
13 | #include <boost/mpl/minus.hpp> | |
14 | #include <boost/mpl/int.hpp> | |
15 | ||
16 | namespace boost { namespace fusion { namespace extension | |
17 | { | |
18 | template <typename> | |
19 | struct at_impl; | |
20 | ||
21 | template <> | |
22 | struct at_impl<reverse_view_tag> | |
23 | { | |
24 | template <typename Seq, typename N> | |
25 | struct apply | |
26 | { | |
27 | typedef mpl::minus<typename Seq::size, mpl::int_<1>, N> real_n; | |
28 | ||
29 | typedef typename | |
30 | result_of::at<typename Seq::seq_type, real_n>::type | |
31 | type; | |
32 | ||
33 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
34 | static type | |
35 | call(Seq& seq) | |
36 | { | |
37 | return fusion::at<real_n>(seq.seq); | |
38 | } | |
39 | }; | |
40 | }; | |
41 | }}} | |
42 | ||
43 | #endif |