1 .. Sequences/Intrinsic Metafunctions//at_c
17 typedef |unspecified| type;
25 Returns a type identical to the ``n``\ th element from the beginning of
26 the sequence. ``at_c<Sequence,n>::type`` is a shorcut notation for
27 ``at< Sequence, long_<n> >::type``.
35 #include <boost/mpl/at.hpp>
42 +---------------+-----------------------------------+-----------------------------------------------+
43 | Parameter | Requirement | Description |
44 +===============+===================================+===============================================+
45 | ``Sequence`` | |Forward Sequence| | A sequence to be examined. |
46 +---------------+-----------------------------------+-----------------------------------------------+
47 | ``n`` | A compile-time integral constant | An offset from the beginning of the sequence |
48 | | | specifying the element to be retrieved. |
49 +---------------+-----------------------------------+-----------------------------------------------+
58 typedef at_c<Sequence,n>::type t;
64 ``0 <= n < size<Sequence>::value``
71 typedef at< Sequence, long_<n> >::type t;
77 +-------------------------------+-----------------------------------+
78 | Sequence archetype | Complexity |
79 +===============================+===================================+
80 | |Forward Sequence| | Linear. |
81 +-------------------------------+-----------------------------------+
82 | |Random Access Sequence| | Amortized constant time. |
83 +-------------------------------+-----------------------------------+
91 typedef range_c<long,10,50> range;
92 BOOST_MPL_ASSERT_RELATION( (at_c< range,0 >::type::value), ==, 10 );
93 BOOST_MPL_ASSERT_RELATION( (at_c< range,10 >::type::value), ==, 20 );
94 BOOST_MPL_ASSERT_RELATION( (at_c< range,40 >::type::value), ==, 50 );
100 |Forward Sequence|, |Random Access Sequence|, |at|, |front|, |back|
103 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
104 Distributed under the Boost Software License, Version 1.0. (See accompanying
105 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)