Classes |
| struct | mbl_stl_select1st< Pair > |
| | select 1st element of a pair (e.g. for map iterators). More...
|
| struct | mbl_stl_select2nd< Pair > |
| | select 2nd element of a pair (e.g. for map iterators). More...
|
| struct | mbl_stl_add2nd< Pair > |
| class | mbl_stl_index_functor< T > |
| | Given a vector of things, select an indexed element. More...
|
| class | mbl_stl_output_t1< Cont > |
| | implementation class for use with mbl_stl_output. More...
|
Functions |
| template<class Out , class T > |
| T | mbl_stl_increments (Out first, Out last, T init) |
| | Fill an output sequence with incrementing values.
|
| template<class Out , class Size , class T > |
| T | mbl_stl_increments_n (Out first, Size n, T init) |
| | Fill the first n values of an output sequence with incrementing values.
|
| template<class Out , class T , class UnOp > |
| T | mbl_stl_sequence (Out first, Out last, UnOp op, T init) |
| | Produces a first order sequence from the supplied unary function.
|
| template<class Out , class Size , class T , class UnOp > |
| T | mbl_stl_sequence_n (Out first, Size n, UnOp op, T init) |
| | Produces a first order sequence of size n from the supplied function.
|
| template<class iterType > |
| void | mbl_stl_clean (iterType first, iterType last) |
| | Clean out a range of pointers.
|
| template<typename InputIterator , typename OutputIterator , typename Predicate > |
| OutputIterator | mbl_stl_copy_if (InputIterator begin, InputIterator end, OutputIterator destBegin, Predicate pred) |
| | Copy elements in input range for which the supplied predicate is true.
|
| template<class Cont > |
| vcl_ostream & | operator<< (vcl_ostream &s, const mbl_stl_output_t1< Cont > &t) |
| | implementation function for use with mbl_stl_output.
|
| template<class Cont > |
| mbl_stl_output_t1< Cont > | mbl_stl_output (const Cont &c, const char *sep=" ") |
| | Allow easy stream output of STL container contents.
|
Useful things missing from vcl_algorithm, etc.
- Author:
- iscott
- Date:
- Dec 2001 Actually, this is mostly an opportunity to mess around in STL to produce code which would be much simpler in ordinary C++. Stroustrup assures us that this approach is faster in general - which I don't really believe.
Added quite a few little functors mainly to do with iterating through maps for example a version of the non-standard select1st and select2nd 30 April 2004 Martin Roberts
Definition in file mbl_stl.h.
template<typename InputIterator , typename OutputIterator , typename Predicate >
| OutputIterator mbl_stl_copy_if |
( |
InputIterator |
begin, |
|
|
InputIterator |
end, |
|
|
OutputIterator |
destBegin, |
|
|
Predicate |
pred |
|
) |
| [inline] |
Copy elements in input range for which the supplied predicate is true.
Note bizarely although the STL provides remove_copy if etc etc the simple copy_if was dropped fromn the C++ standard
Definition at line 87 of file mbl_stl.h.
template<class Out , class T >
| T mbl_stl_increments |
( |
Out |
first, |
|
|
Out |
last, |
|
|
T |
init |
|
) |
| [inline] |
Fill an output sequence with incrementing values.
A bit like vcl_fill, but after each assignment, the value is incremented.
- Returns:
- the next value in the sequence.
Definition at line 27 of file mbl_stl.h.
template<class Out , class Size , class T >
| T mbl_stl_increments_n |
( |
Out |
first, |
|
|
Size |
n, |
|
|
T |
init |
|
) |
| [inline] |
Fill the first n values of an output sequence with incrementing values.
A bit like vcl_fill_n, but after each assignment, the value is incremented.
- Returns:
- the next value in the sequence.
Definition at line 38 of file mbl_stl.h.
template<class Out , class T , class UnOp >
| T mbl_stl_sequence |
( |
Out |
first, |
|
|
Out |
last, |
|
|
UnOp |
op, |
|
|
T |
init |
|
) |
| [inline] |
Produces a first order sequence from the supplied unary function.
The value produced at a given step is a function of the previous value. E.g. the following is equivalent to using mbl_stl_increments
mbl_stl_sequence(A.begin(), A.end(), vcl_bind1st(vcl_plus<unsigned>(), 1u), 0u);
- Returns:
- the next value in the sequence.
Definition at line 52 of file mbl_stl.h.
template<class Out , class Size , class T , class UnOp >
| T mbl_stl_sequence_n |
( |
Out |
first, |
|
|
Size |
n, |
|
|
UnOp |
op, |
|
|
T |
init |
|
) |
| [inline] |
Produces a first order sequence of size n from the supplied function.
The value produced at a given step is a function of the previous value. E.g. the following is equivalent to using mbl_stl_increments
- Returns:
- the next value in the sequence.
Definition at line 63 of file mbl_stl.h.