1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3 Copyright (c) 2011 Brandon Kohn
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(BOOST_FUSION_MAP_DETAIL_AT_IMPL_HPP)
9 #define BOOST_FUSION_MAP_DETAIL_AT_IMPL_HPP
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/fusion/support/detail/access.hpp>
13 #include <boost/type_traits/is_const.hpp>
14 #include <boost/mpl/at.hpp>
15 #include <boost/mpl/int.hpp>
17 namespace boost { namespace fusion
23 template <typename Tag>
27 struct at_impl<map_tag>
29 template <typename Sequence, typename N>
33 mpl::at<typename Sequence::storage_type::types, N>::type
35 typedef typename detail::ref_result<element>::type type;
37 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
41 return m.get_data().at_impl(N());
45 template <typename Sequence, typename N>
46 struct apply<Sequence const, N>
49 mpl::at<typename Sequence::storage_type::types, N>::type
51 typedef typename detail::cref_result<element>::type type;
53 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
55 call(Sequence const& m)
57 return m.get_data().at_impl(N());
64 #endif //BOOST_FUSION_MAP_DETAIL_AT_IMPL_HPP