1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
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_AT_IMPL_05042005_0741)
8 #define FUSION_AT_IMPL_05042005_0741
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/fusion/support/detail/access.hpp>
12 #include <boost/type_traits/is_const.hpp>
13 #include <boost/mpl/at.hpp>
14 #include <boost/mpl/int.hpp>
16 namespace boost { namespace fusion
22 template <typename Tag>
26 struct at_impl<vector_tag>
28 template <typename Sequence, typename N>
31 typedef typename mpl::at<typename Sequence::types, N>::type element;
32 typedef typename detail::ref_result<element>::type type;
34 BOOST_FUSION_GPU_ENABLED
38 BOOST_STATIC_ASSERT((N::value < Sequence::size::value));
39 return v.at_impl(N());
43 template <typename Sequence, typename N>
44 struct apply <Sequence const, N>
46 typedef typename mpl::at<typename Sequence::types, N>::type element;
47 typedef typename detail::cref_result<element>::type type;
49 BOOST_FUSION_GPU_ENABLED
51 call(Sequence const& v)
53 BOOST_STATIC_ASSERT((N::value < Sequence::size::value));
54 return v.at_impl(N());