Aleph-w  1.9
General library for algorithms and data structures
GenericTraverse< Container > Struct Template Reference

#include <ah-dry.H>

Public Member Functions

template<class Operation >
bool traverse (Operation &operation) noexcept(noexcept(operation))
 
template<class Operation >
bool traverse (Operation &operation) const noexcept(noexcept(operation))
 
template<class Operation >
bool traverse (Operation &&operation) const noexcept(noexcept(operation))
 
template<class Operation >
bool traverse (Operation &&operation) noexcept(noexcept(operation))
 

Detailed Description

template<class Container>
struct GenericTraverse< Container >

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

Member Function Documentation

◆ traverse() [1/4]

template<class Container >
template<class Operation >
bool GenericTraverse< Container >::traverse ( Operation &  operation)
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.

Parameters
[in]operationto be performed on each item
Returns
true if all the items were visited (operation on each one always returned true) or false if the traversal was stoppep because there was a false result on an item.
Exceptions
anythingthat could throw operation
+ Here is the caller graph for this function:

◆ traverse() [2/4]

template<class Container >
template<class Operation >
bool GenericTraverse< Container >::traverse ( Operation &  operation) const
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ traverse() [3/4]

template<class Container >
template<class Operation >
bool GenericTraverse< Container >::traverse ( Operation &&  operation) const
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ traverse() [4/4]

template<class Container >
template<class Operation >
bool GenericTraverse< Container >::traverse ( Operation &&  operation)
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

+ Here is the call graph for this function:

The documentation for this struct was generated from the following file:

Leandro Rabindranath León