3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/vector.html
| Prev Next | Back Along | Up Home | Full TOC | Front Page / Sequences / Classes / vector |
vector is a variadic, random access, extensible sequence of types that supports constant-time insertion and removal of elements at both ends, and linear-time insertion and removal of elements in the middle. On compilers that support the typeof extension, vector is the simplest and in many cases the most efficient sequence.
| Sequence form | Header |
|---|---|
| Variadic | #include <boost/mpl/vector.hpp> |
| Numbered | #include <boost/mpl/vector/vector_n_.hpp> |
In the following table, v is an instance of vector, pos and last are iterators into v, r is a Forward Sequence, n is an Integral Constant, and x and _t_1,_t_2,... _t_n are arbitrary types.
| Expression | Semantics |
|---|---|
[vector](./vector.html)<_t_1,_t_2,..._t_n>[vector](./vector.html)_n_<_t_1,_t_2,..._t_n>
| vector of elements _t_1,_t_2,... _t_n; see Variadic Sequence. | |
[vector](./vector.html)<_t_1,_t_2,..._t_n>::type[vector](./vector.html)_n_<_t_1,_t_2,..._t_n>::type
| Identical to vectorn<_t_1,_t_2,... _t_n>; see Variadic Sequence. | | begin<v>::type | An iterator pointing to the beginning of v; see Random Access Sequence. | | end<v>::type | An iterator pointing to the end of v; see Random Access Sequence. | | size<v>::type | The size of v; see Random Access Sequence. | | empty<v>::type | A boolean Integral Constant c such that c::value == true if and only if the sequence is empty; see Random Access Sequence. | | front<v>::type | The first element in v; see Random Access Sequence. | | back<v>::type | The last element in v; see Random Access Sequence. | | at<v,n>::type | The nth element from the beginning of v; see Random Access Sequence. | | insert<v,pos,x>::type | A new vector of following elements: [begin<v>::type, pos), x, [pos, end<v>::type); see Extensible Sequence. | | insert_range<v,pos,r>::type | A new vector of following elements: [begin<v>::type, pos), [begin<r>::type, end<r>::type) [pos, end<v>::type); see Extensible Sequence. | | erase<v,pos>::type | A new vector of following elements: [begin<v>::type, pos), [next<pos>::type, end<v>::type); see Extensible Sequence. | | erase<v,pos,last>::type | A new vector of following elements: [begin<v>::type, pos), [last, end<v>::type); see Extensible Sequence. | | clear<v>::type | An empty vector; see Extensible Sequence. | | push_back<v,x>::type | A new vector of following elements: [begin<v>::type, end<v>::type), x; see Back Extensible Sequence. | | pop_back<v>::type | A new vector of following elements: [begin<v>::type, prior< end<v>::type >::type); see Back Extensible Sequence. | | push_front<v,x>::type | A new vector of following elements: x, [begin<v>::type, end<v>::type); see Front Extensible Sequence. | | pop_front<v>::type | A new vector of following elements: [next< begin<v>::type >::type, end<v>::type); see Front Extensible Sequence. |
typedef[vector](./vector.html)<float,double,long double> floats;
typedef[push\_back](./push-back.html)<floats,int>::type types;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[at\_c](./at-c.html)<types,3>::type, int > ));
Sequences, Variadic Sequence, Random Access Sequence, Extensible Sequence, vector_c, list
| 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) |