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 112 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) |
virtual void | run (Arg arg) |
Private Attributes | |
uint | NUM_ELMS {0} |
|
inlineprivate |
The invoked test function will print its argument
Definition at line 161 of file util-foreach-test.cpp.
|
inlineprivate |
Definition at line 185 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 236 of file util-foreach-test.cpp.
|
inlineprivate |
Definition at line 286 of file util-foreach-test.cpp.
|
inlineprivate |
Definition at line 322 of file util-foreach-test.cpp.
|
inlineprivate |
Definition at line 344 of file util-foreach-test.cpp.
|
inlineprivate |
Using lambda expressions as predicates
Definition at line 362 of file util-foreach-test.cpp.
|
inlineprivate |
this
pointer to specify the object instance Definition at line 388 of file util-foreach-test.cpp.
|
inlineprivate |
Definition at line 426 of file util-foreach-test.cpp.