|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Generic traversal of the container through its iterator. More...
#include <ah-dry.H>
Public Member Functions | |
| template<class Operation > | |
| bool | traverse (Operation &operation) noexcept(traverse_is_noexcept< Operation >()) |
| Traverse the container via its iterator and performs a conditioned operation on each item. | |
| template<class Operation > | |
| bool | traverse (Operation &operation) const noexcept(traverse_is_noexcept< Operation >()) |
Const overload of traverse(Operation&). | |
| template<class Operation > | |
| bool | traverse (Operation &&operation) const noexcept(traverse_is_noexcept< Operation >()) |
Overload of traverse(Operation&) const that accepts rvalues. | |
| template<class Operation > | |
| bool | traverse (Operation &&operation) noexcept(traverse_is_noexcept< Operation >()) |
Overload of traverse(Operation&) that accepts rvalues. | |
Static Private Member Functions | |
| template<class Operation > | |
| static constexpr bool | traverse_is_noexcept () noexcept |
Generic traversal of the container through its iterator.
This class implements a conditioned traversal on the container through its iterator.
It is assumed that Container exports its iterator with
typename Container::Iterator
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Traverse the container via its iterator and performs a conditioned operation on each item.
traverse(operation) instantiates the internal iterator of the class and traverses each item performing operation(item).
operation must have the following signature:
bool operation(const typename Container::Item_Type & item)
If operation(item) returns true then the iterator is advanced and the next item processed. Otherwise. the traversal stops.
| [in] | operation | to be performed on each item |
true if all the items were visited (operation on each one always returned true) or false if the traversal was stopped because there was a false result on an item. | anything | that could throw operation |
Definition at line 95 of file ah-dry.H.
Referenced by demo_iteration(), Aleph::LocateMixin< Derived, Type >::find_ptr(), Aleph::LocateMixin< Derived, Type >::find_ptr(), Aleph::for_each_in_order(), Aleph::for_each_postorder(), Aleph::for_each_preorder(), Aleph::LocateMixin< Derived, Type >::nth(), Aleph::LocateMixin< Derived, Type >::nth_ne(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), Aleph::DynListQueue< T >::traverse(), Aleph::DynListStack< T >::traverse(), Aleph::DynListQueue< T >::traverse(), Aleph::DynListStack< T >::traverse(), Aleph::DynListQueue< T >::traverse(), Aleph::DynListStack< T >::traverse(), Aleph::DynListQueue< T >::traverse(), Aleph::DynListStack< T >::traverse(), and TYPED_TEST().
|
inlinestaticconstexprprivatenoexcept |