TRIQS/itertools 1.3.0
C++ range library
|
#include <itertools/transform.hpp>
Iterator for a itertools::transformed range.
It stores an iterator of the original range and a callable object that is used to transform the elements of the original range. Incrementing simply increments the iterator. Dereferencing returns the result of the callable object applied to the dereferenced iterator, i.e. the transformed element.
See itertools::transform(R &&, F) for more details.
Iter | Iterator type. |
F | Callable type. |
Value | Return type of the callable. |
Definition at line 50 of file transform.hpp.
Public Member Functions | |
transform_iter ()=default | |
Default constructor. | |
transform_iter (Iter it, F lambda) | |
Construct a transformed iterator from a given iterator and callable. | |
transform_iter (transform_iter &&)=default | |
Default move constructor. | |
transform_iter (transform_iter const &)=default | |
Default copy constructor. | |
decltype(auto) | dereference () const |
Dereference the iterator. | |
void | increment () |
Increment the iterator by incrementing the original iterator. | |
transform_iter & | operator= (transform_iter &&)=default |
Default move assignment operator. | |
transform_iter & | operator= (transform_iter const &other) |
Custom copy assignment operator makes sure that the optional callable is correctly copied. | |
template<typename SentinelIter > | |
bool | operator== (sentinel_t< SentinelIter > const &s) const |
Equal-to operator for a itertools::transform_iter and an itertools::sentinel_t. | |
bool | operator== (transform_iter const &other) const |
Equal-to operator for two itertools::transform_iter objects. | |
Public Attributes | |
Iter | it |
Iterator of the original range. | |
std::optional< F > | lambda |
Callable doing the transformation. | |
|
inline |
Construct a transformed iterator from a given iterator and callable.
it | Iterator of the original range. |
lambda | Callable doing the transformation. |
Definition at line 66 of file transform.hpp.
|
inlinenodiscard |
Dereference the iterator.
Definition at line 114 of file transform.hpp.
|
inline |
Custom copy assignment operator makes sure that the optional callable is correctly copied.
other | itertools::transform_iter to copy from. |
Definition at line 84 of file transform.hpp.
|
inlinenodiscard |
Equal-to operator for a itertools::transform_iter and an itertools::sentinel_t.
SentinelIter | Iterator type of the sentinel. |
s | itertools::sentinel_t to compare with. |
Definition at line 108 of file transform.hpp.
|
inlinenodiscard |
Equal-to operator for two itertools::transform_iter objects.
other | itertools::transform_iter to compare with. |
Definition at line 99 of file transform.hpp.