|
CBMC
|
Iterator which only stops at elements for which some given function f is true.
More...
#include <range.h>
Collaboration diagram for filter_iteratort< iteratort >:Public Types | |
| using | difference_type = typename iteratort::difference_type |
| using | value_type = typename iteratort::value_type |
| using | pointer = typename iteratort::pointer |
| using | reference = typename iteratort::reference |
| using | iterator_category = std::forward_iterator_tag |
Public Member Functions | |
| bool | operator== (const filter_iteratort &other) const |
| bool | operator!= (const filter_iteratort &other) const |
| filter_iteratort & | operator++ () |
| Preincrement operator. More... | |
| filter_iteratort | operator++ (int) |
| Postincrement operator. More... | |
| reference | operator* () const |
| pointer | operator-> () const |
| filter_iteratort (std::shared_ptr< std::function< bool(const value_type &)>> f, iteratort underlying, iteratort end) | |
Filter between underlying and end using f. More... | |
Private Member Functions | |
| void | point_to_first_to_peek () |
Ensure that the underlying iterator is always positioned on an element for which f is true. More... | |
Private Attributes | |
| iteratort | underlying |
| const iteratort | underlying_end |
| std::shared_ptr< std::function< bool(const value_type &)> > | f |
Iterator which only stops at elements for which some given function f is true.
| using filter_iteratort< iteratort >::difference_type = typename iteratort::difference_type |
| using filter_iteratort< iteratort >::iterator_category = std::forward_iterator_tag |
| using filter_iteratort< iteratort >::pointer = typename iteratort::pointer |
| using filter_iteratort< iteratort >::reference = typename iteratort::reference |
| using filter_iteratort< iteratort >::value_type = typename iteratort::value_type |
|
inline |
Filter between underlying and end using f.
If f is not true for any element between underlying and end, the constructed iterator is equal to the one which would have been constructed using
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
Ensure that the underlying iterator is always positioned on an element for which f is true.
This does nothing if f is satisfied at the current position. If f is not true for any element between underlying and underlying_end underlying will be incremented until underlying_end is reached.
|
private |
|
private |
|
private |