Back to Arangodb

at_c

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/at-c.html

3.12.9.12.7 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Sequences / Intrinsic Metafunctions / at_c |

at_c

Synopsis

template<
      typename Sequence
    , long n
    >
struct[at\_c](./at-c.html){
    typedef_unspecified_type;
};

Description

Returns a type identical to the nth element from the beginning of the sequence. at_c<Sequence,n>::type is a shorcut notation for at< Sequence, long_<n> >::type.

#include <[boost/mpl/at.hpp](../../../../boost/mpl/at.hpp)>

Parameters

ParameterRequirementDescription
SequenceForward SequenceA sequence to be examined.
nA compile-time integral constantAn offset from the beginning of the sequence specifying the element to be retrieved.

Expression semantics

typedef[at\_c](./at-c.html)<Sequence,n>::type t;

| Return type: |

A type

| | Precondition: |

0 <= n < size<Sequence>::value

| | Semantics: |

Equivalent to

typedef[at](./at.html)< Sequence,[long\_](./long.html)<n> >::type t;

|

Complexity

Sequence archetypeComplexity
Forward SequenceLinear.
Random Access SequenceAmortized constant time.

Example

typedef[range\_c](./range-c.html)<long,10,50> range;[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)( ([at\_c](./at-c.html)< range,0 >::type::value), ==, 10 );[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)( ([at\_c](./at-c.html)< range,10 >::type::value), ==, 20 );[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)( ([at\_c](./at-c.html)< range,40 >::type::value), ==, 50 );

See also

Forward Sequence, Random Access Sequence, at, front, back

| Prev Next | Back Along | Up Home | Full TOC |

Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |