...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Front Page / Sequences / Classes / list |
A list is a variadic, forward, extensible sequence of types that supports constant-time insertion and removal of elements at the beginning, and linear-time insertion and removal of elements at the end and in the middle.
Sequence form | Header |
---|---|
Variadic | #include <boost/mpl/list.hpp> |
Numbered | #include |
In the following table, l is a list, pos and last are iterators into l, r is a Forward Sequence, and t1,t2,... tn and x are arbitrary types.
Expression | Semantics |
---|---|
list<t1,t2,... tn> listn<t1,t2,... tn> |
list of elements t1,t2,... tn; see Variadic Sequence. |
list<t1,t2,... tn>::type listn<t1,t2,... tn>::type |
Identical to listn<t1,t2,... tn>; see Variadic Sequence. |
begin |
An iterator to the beginning of l; see Forward Sequence. |
end |
An iterator to the end of l; see Forward Sequence. |
size |
The size of l; see Forward Sequence. |
empty |
A boolean Integral Constant c such that c::value == true if and only if l is empty; see Forward Sequence. |
front |
The first element in l; see Forward Sequence. |
insert |
A new list of following elements:
[begin |
insert_range |
A new list of following elements:
[begin |
erase |
A new list of following elements:
[begin |
erase |
A new list of following elements:
[begin |
clear |
An empty list; see Extensible Sequence. |
push_front |
A new list containing x as its first element; see Front Extensible Sequence. |
pop_front |
A new list containing all but the first elements of l in the same order; see Front Extensible Sequence. |
typedef listfloats; typedef push_front ::type types; BOOST_MPL_ASSERT(( is_same< front ::type, int > ));