Lumiera
0.pre.03
»edit your freedom«
|
Covers the various flavours of these convenience helpers: They might operate either on a STL container (providing begin()
and end()
functions), or at a "Lumiera
Forward Iterator", which is incremented and dereferenced for each value it yields, until exhaustion.
Moreover for each of these cases, there are additional overloads allowing to create a bind-expression on-the fly. As a further variation of this scheme, an predicate can be evaluated for each element, either with universal quantisation (results are && combined), or with existential quantisation.
Definition at line 123 of file util-foreach-test.cpp.
Classes | |
struct | Dummy |
struct | TestElm |
Private Member Functions | |
template<typename CO > | |
void | check_existence_quant (CO coll) |
template<typename CO > | |
void | check_foreach_bind (CO coll) |
template<typename CO > | |
void | check_foreach_bind_const (CO const &coll) |
template<typename CO > | |
void | check_foreach_lambda (CO coll) |
template<typename CO > | |
void | check_foreach_memFun (CO coll) |
template<typename CO > | |
void | check_foreach_plain (CO coll) |
void | check_invoke_on_each () |
template<typename CO > | |
void | check_ref_argument_bind (CO coll) |
void | check_wrapped_container_passing (VecI coll) |
void | run (Arg arg) |
|
inlineprivate |
The invoked test function will print its argument
Definition at line 172 of file util-foreach-test.cpp.
|
inlineprivate |
Definition at line 196 of file util-foreach-test.cpp.
|
inlineprivate |
In the example performed here, the function to be applied takes the 3rd argument by reference and assigns the sum of first and second argument to this parameter. If we us a bind variable at that position, we end up assigning by reference to the values contained in the collection.
Definition at line 247 of file util-foreach-test.cpp.
|
inlineprivate |
Definition at line 297 of file util-foreach-test.cpp.
|
inlineprivate |
Definition at line 333 of file util-foreach-test.cpp.
|
inlineprivate |
Definition at line 355 of file util-foreach-test.cpp.
|
inlineprivate |
Using lambda expressions as predicates
Definition at line 373 of file util-foreach-test.cpp.
|
inlineprivate |
this
pointer to specify the object instance Definition at line 399 of file util-foreach-test.cpp.
|
inlineprivate |
Definition at line 437 of file util-foreach-test.cpp.