|
edelib
1.0
|
Functions | |
| template<typename T , typename F > | |
| unsigned int | filter (const F &func, const T &container, T &ret) |
| template<typename T , typename F > | |
| void | map (F &func, const T &container, T &ret) |
| template<typename T , typename R , typename F > | |
| void | reduce (F &func, const T &container, R &ret) |
| template<typename T , typename F > | |
| void | for_each (const F &func, const T &container) |
| template<typename T , typename F > | |
| void | for_each (const F &func, const T &container, void *p) |
| unsigned int edelib::filter | ( | const F & | func, |
| const T & | container, | ||
| T & | ret | ||
| ) |
Filter given container by calling func on each element. If func returns true for given element, it will be copied to other list.
| void edelib::for_each | ( | const F & | func, |
| const T & | container | ||
| ) |
Traverse container calling func on each element. Returns nothing.
| void edelib::for_each | ( | const F & | func, |
| const T & | container, | ||
| void * | p | ||
| ) |
Same as above for_each, but with additional void* parameter that is given to function as second parameter (function is called as func(val, void*)
| void edelib::map | ( | F & | func, |
| const T & | container, | ||
| T & | ret | ||
| ) |
Apply func on each element of given container and add it to ret container.
| void edelib::reduce | ( | F & | func, |
| const T & | container, | ||
| R & | ret | ||
| ) |
Reduce all elements from container using func as function. The best example of this is to sum all elements, like:
1.8.11