|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Container traversal and functional operation mixins. More...
Go to the source code of this file.
Classes | |
| struct | GenericTraverse< Container > |
| Generic traversal of the container through its iterator. More... | |
| class | LocateFunctions< Container, Type > |
| Common sequential searching methods on containers. More... | |
| struct | SpecialCtors< Container, T > |
Special constructors common to Aleph-w ( \(\aleph_\omega\)) containers. More... | |
| class | FunctionalMethods< Container, T > |
Common methods to the Aleph-w ( \(\aleph_\omega\)) containers. More... | |
| struct | GenericItems< Container, T > |
| Generic list of items stored in a container. More... | |
| class | EqualSequenceMethod< Container > |
| Mixin providing equality comparison for sequence containers. More... | |
| class | EqualToMethod< Container > |
| Equality test for containers. More... | |
| class | MapSequencesMethods< Container, Key, Data > |
| Common methods to mapping containers. More... | |
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
Typedefs | |
| template<class Container , typename T > | |
| using | GenericKeys = GenericItems< Container, T > |
| Alias to GenricItems functor. | |
Functions | |
| template<class Container , class Operation > | |
| bool | traverse (const Container &c, Operation &op) noexcept(noexcept(c.traverse(op))) |
Invoke c.traverse(op) as a free function (lvalue operation). | |
| template<class Container , class Operation > | |
| bool | traverse (const Container &c, Operation &&op) noexcept(noexcept(c.traverse(op))) |
Invoke c.traverse(op) as a free function (rvalue overload). | |
Container traversal and functional operation mixins.
This file provides generic traversal classes and mixins that implement functional operations (for_each, exists, all, filter, map, etc.) for containers through their iterators. These follow the DRY principle.
Definition in file ah-dry.H.
| using GenericKeys = GenericItems<Container, T> |
|
noexcept |
Invoke c.traverse(op) as a free function (rvalue overload).
Overload for temporary / rvalue callables such as lambda expressions. The operation op is passed (invoked) as a named lvalue to the member overload rather than being perfectly forwarded.
| Container | Any type that provides a traverse(Operation&) member. |
| Operation | Callable with signature bool(Item_Type &). |
| [in] | c | Container to traverse. |
| [in] | op | Operation passed (invoked) as a named lvalue to the member overload rather than being perfectly forwarded. |
true if all elements were visited, false if traversal was stopped. | anything | that op throws. |
|
noexcept |
Invoke c.traverse(op) as a free function (lvalue operation).
Convenience wrapper so that traverse(container, op) can be used in generic code without depending on the container type.
| Container | Any type that provides a traverse(Operation&) member. |
| Operation | Callable with signature bool(Item_Type &). |
| [in] | c | Container to traverse. |
| [in] | op | Operation to apply to each element; return false to stop. |
true if all elements were visited, false if traversal was stopped. | anything | that op throws. |
Definition at line 145 of file ah-dry.H.
Referenced by FunctionalMethods< Container, T >::exists().