# at

### Synopsis

    template<
          typename N
        , typename Sequence
        >
    struct at
    {
        typedef unspecified type;
    };

### Description

Returns a type identical to the `N`-th element from the beginning of the sequence.

### Definition

    #include "boost/mpl/at.hpp"

### Parameters

Parameter | Requirement | Description
--- | --- | ---
`N` | A model of Integral Constant | The offset from the beginning of the sequence that specifies the element to be retrieved.
`Sequence` | A model of Forward Sequence | A sequence to be examined.

### Expression semantics

Expression | Expression type | Precondition | Semantics | Postcondition
--- | --- | --- | --- | ---
`typedef at<N,Sequence>::type t;` | A type | `0 <= N::value < size<Sequence>::type::value` | Equivalent to `typedef advance< begin<Sequence>::type,N >::type::type t;` |

### Complexity

Depends on the implementation of the particular sequence it is applied to. Linear in the worst case, or amortized constant time.

### Example

    typedef range_c<long,10,50> range;
    BOOST_STATIC_ASSERT(at< int_c<0>, range >::type::value == 10);
    BOOST_STATIC_ASSERT(at< int_c<10>, range >::type::value == 20);
    BOOST_STATIC_ASSERT(at< int_c<40>, range >::type::value == 50);

### See also

Forward Sequence, `at_c`, `front`, `back`

Table of Content | Reference
Last edited July 17, 2002 3:49 am