]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2013 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(BOOST_FUSION_MAP_DETAIL_AT_IMPL_02042013_0821) | |
8 | #define BOOST_FUSION_MAP_DETAIL_AT_IMPL_02042013_0821 | |
9 | ||
10 | #include <boost/fusion/support/config.hpp> | |
11 | #include <boost/fusion/support/detail/access.hpp> | |
12 | #include <boost/utility/declval.hpp> | |
13 | ||
14 | namespace boost { namespace fusion | |
15 | { | |
16 | struct map_tag; | |
17 | ||
18 | namespace extension | |
19 | { | |
20 | template <typename Tag> | |
21 | struct at_impl; | |
22 | ||
23 | template <> | |
24 | struct at_impl<map_tag> | |
25 | { | |
26 | template <typename Sequence, typename N> | |
27 | struct apply | |
28 | { | |
29 | typedef mpl::int_<N::value> index; | |
30 | typedef | |
31 | decltype(boost::declval<Sequence>().get(index())) | |
32 | type; | |
33 | ||
34 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
35 | static type | |
36 | call(Sequence& m) | |
37 | { | |
38 | return m.get(index()); | |
39 | } | |
40 | }; | |
41 | ||
42 | template <typename Sequence, typename N> | |
43 | struct apply<Sequence const, N> | |
44 | { | |
45 | typedef mpl::int_<N::value> index; | |
46 | typedef | |
47 | decltype(boost::declval<Sequence const>().get(index())) | |
48 | type; | |
49 | ||
50 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
51 | static type | |
52 | call(Sequence const& m) | |
53 | { | |
54 | return m.get(index()); | |
55 | } | |
56 | }; | |
57 | }; | |
58 | } | |
59 | }} | |
60 | ||
61 | #endif |