fix doc example typo
[boost.git] / boost / fusion / container / deque / detail / value_at_impl.hpp
blobec0351de63fb42fa5d0446f2345de7bcda0d2c5a
1 /*=============================================================================
2 Copyright (c) 2001-2006 Joel de Guzman
3 Copyright (c) 2005-2006 Dan Marsden
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_DEQUE_VALUE_AT_IMPL_08122006_0756)
9 #define BOOST_FUSION_DEQUE_VALUE_AT_IMPL_08122006_0756
11 #include <boost/fusion/container/deque/detail/keyed_element.hpp>
13 #include <boost/mpl/equal_to.hpp>
14 #include <boost/mpl/assert.hpp>
16 namespace boost { namespace fusion {
18 struct deque_tag;
20 namespace extension
22 template<typename T>
23 struct value_at_impl;
25 template<>
26 struct value_at_impl<deque_tag>
28 template<typename Sequence, typename N>
29 struct apply
31 typedef typename Sequence::next_up next_up;
32 typedef typename Sequence::next_down next_down;
33 BOOST_MPL_ASSERT_RELATION(next_down::value, !=, next_up::value);
35 typedef mpl::plus<next_down, mpl::int_<1> > offset;
36 typedef mpl::int_<mpl::plus<N, offset>::value> adjusted_index;
37 typedef typename detail::keyed_element_value_at<Sequence, adjusted_index>::type type;
43 #endif