Chris@16
|
1 /*=============================================================================
|
Chris@16
|
2 Copyright (c) 2001-2013 Joel de Guzman
|
Chris@16
|
3
|
Chris@16
|
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 ==============================================================================*/
|
Chris@16
|
7 #if !defined(BOOST_FUSION_MAP_DETAIL_AT_IMPL_02042013_0821)
|
Chris@16
|
8 #define BOOST_FUSION_MAP_DETAIL_AT_IMPL_02042013_0821
|
Chris@16
|
9
|
Chris@101
|
10 #include <boost/fusion/support/config.hpp>
|
Chris@16
|
11 #include <boost/fusion/support/detail/access.hpp>
|
Chris@101
|
12 #include <boost/utility/declval.hpp>
|
Chris@16
|
13
|
Chris@16
|
14 namespace boost { namespace fusion
|
Chris@16
|
15 {
|
Chris@16
|
16 struct map_tag;
|
Chris@16
|
17
|
Chris@16
|
18 namespace extension
|
Chris@16
|
19 {
|
Chris@16
|
20 template <typename Tag>
|
Chris@16
|
21 struct at_impl;
|
Chris@16
|
22
|
Chris@16
|
23 template <>
|
Chris@16
|
24 struct at_impl<map_tag>
|
Chris@16
|
25 {
|
Chris@16
|
26 template <typename Sequence, typename N>
|
Chris@16
|
27 struct apply
|
Chris@16
|
28 {
|
Chris@16
|
29 typedef mpl::int_<N::value> index;
|
Chris@16
|
30 typedef
|
Chris@101
|
31 decltype(boost::declval<Sequence>().get(index()))
|
Chris@16
|
32 type;
|
Chris@16
|
33
|
Chris@101
|
34 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
Chris@16
|
35 static type
|
Chris@16
|
36 call(Sequence& m)
|
Chris@16
|
37 {
|
Chris@16
|
38 return m.get(index());
|
Chris@16
|
39 }
|
Chris@16
|
40 };
|
Chris@16
|
41
|
Chris@16
|
42 template <typename Sequence, typename N>
|
Chris@16
|
43 struct apply<Sequence const, N>
|
Chris@16
|
44 {
|
Chris@16
|
45 typedef mpl::int_<N::value> index;
|
Chris@16
|
46 typedef
|
Chris@101
|
47 decltype(boost::declval<Sequence const>().get(index()))
|
Chris@16
|
48 type;
|
Chris@16
|
49
|
Chris@101
|
50 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
Chris@16
|
51 static type
|
Chris@16
|
52 call(Sequence const& m)
|
Chris@16
|
53 {
|
Chris@16
|
54 return m.get(index());
|
Chris@16
|
55 }
|
Chris@16
|
56 };
|
Chris@16
|
57 };
|
Chris@16
|
58 }
|
Chris@16
|
59 }}
|
Chris@16
|
60
|
Chris@16
|
61 #endif
|