![]() |
Home | Libraries | People | FAQ | More |
Returns the N-th element from the beginning of the sequence.
template <typename N, typename Sequence> typenameresult_of::at
<Sequence, N>::type at(Sequence& seq); template <typename N, typename Sequence> typenameresult_of::at
<Sequence const, N>::type at(Sequence const& seq);
Parameter | Requirement | Description |
---|---|---|
seq |
Model of Random Access Sequence | The sequence we wish to investigate. |
N |
An MPL integral constant | An index from the beginning of the sequence. |
at<N>(seq);
Return type: Returns a reference to
the N-th element from the beginning of the sequence seq
if seq
is mutable and
e =
o
, where e
is the N-th element from the beginning of the sequence, is a valid expression.
Else, returns a type convertable to the N-th element from the beginning
of the sequence.
Precondition: 0
<= N::value <
size
(s)
Semantics: Equivalent to
deref
(advance
<N>(begin
(s)))
#include <boost/fusion/sequence/intrinsic/at.hpp>
vector
<int, int, int> v(1, 2, 3);
assert(at<mpl::int_<1> >(v) == 2);
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger |