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/fusion/container/vector/detail/value_at_impl.hpp>
13 #include <boost/static_assert.hpp>
15 namespace boost { namespace fusion
21 template <typename Tag>
25 struct at_impl<vector_tag>
27 template <typename Sequence, typename N>
30 typedef typename value_at_impl<vector_tag>::template apply<Sequence, N>::type element;
31 typedef typename detail::ref_result<element>::type type;
33 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
37 BOOST_STATIC_ASSERT((N::value < Sequence::size::value));
38 return v.at_impl(N());
42 template <typename Sequence, typename N>
43 struct apply <Sequence const, N>
45 typedef typename value_at_impl<vector_tag>::template apply<Sequence, N>::type element;
46 typedef typename detail::cref_result<element>::type type;
48 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
50 call(Sequence const& v)
52 BOOST_STATIC_ASSERT((N::value < Sequence::size::value));
53 return v.at_impl(N());