3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/at.html
| Prev Next | Back Along | Up Home | Full TOC | Front Page / Sequences / Intrinsic Metafunctions / at |
template<
typename Sequence
, typename N
>
struct[at](./at.html){
typedef_unspecified_type;
};
template<
typename AssocSeq
, typename Key
, typename Default =_unspecified_>
struct[at](./at.html){
typedef_unspecified_type;
};
at is an overloaded name:
#include <[boost/mpl/at.hpp](../../../../boost/mpl/at.hpp)>
| Parameter | Requirement | Description |
|---|---|---|
| Sequence | Forward Sequence | A sequence to be examined. |
| AssocSeq | Associative Sequence | A sequence to be examined. |
| N | Integral Constant | An offset from the beginning of the sequence specifying the element to be retrieved. |
| Key | Any type | A key for the element to be retrieved. |
| Default | Any type | A default value to return if the element is not found. |
For any Forward Sequence s, and Integral Constant n:
typedef[at](./at.html)<s,n>::type t;
| Return type: |
A type.
| | Precondition: |
0 <= n::value < size<s>::value.
| | Semantics: |
Equivalent to
typedef[deref](./deref.html)<[advance](./advance.html)<[begin](./begin.html)<s>::type,n >::type >::type t;
|
For any Associative Sequence s, and arbitrary types key and x:
typedef[at](./at.html)<s,key,x>::type t;
| Return type: | A type. | | Semantics: | If has_key<s,key>::value == true, t is the value type associated with key; otherwise t is identical to x. |
typedef[at](./at.html)<s,key>::type t;
| Return type: |
A type.
| | Semantics: |
Equivalent to
typedef[at](./at.html)<s,key,[void\_](./void.html)>::type t;
|
| Sequence archetype | Complexity |
|---|---|
| Forward Sequence | Linear. |
| Random Access Sequence | Amortized constant time. |
| Associative Sequence | Amortized constant time. |
typedef[range\_c](./range-c.html)<long,10,50> range;[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)( ([at](./at.html)< range,[int\_](./int.html)<0> >::value), ==, 10 );[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)( ([at](./at.html)< range,[int\_](./int.html)<10> >::value), ==, 20 );[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)( ([at](./at.html)< range,[int\_](./int.html)<40> >::value), ==, 50 );
typedef[set](./set.html)< int const,long*,double > s;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[at](./at.html)<s,char>::type,[void\_](./void.html)> ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[at](./at.html)<s,int>::type, int > ));
Forward Sequence, Random Access Sequence, Associative Sequence, at_c, 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) |