kblib 0.2.3
General utilities library for modern C++
|
An InputIterator that applies a transformation to the elements of the range. More...
#include <kblib/iterators.h>
Public Types | |
using | difference_type = std::ptrdiff_t |
using | result_type = decltype(kblib::invoke(op, *it)) |
using | const_result_type = decltype(kblib::invoke(std::as_const(op), *std::as_const(it))) |
using | value_type = result_type |
using | pointer = void |
using | reference = value_type |
using | iterator_category = std::input_iterator_tag |
Public Member Functions | |
transform_iterator (base_iterator _it, operation _op) noexcept(noexcept(base_iterator{ _it}) and noexcept(std::is_nothrow_move_constructible< operation >::value)) | |
Constructs a transform_iterator which applies _op to the values obtained from *_it. More... | |
transform_iterator (base_iterator end_it) noexcept(noexcept(base_iterator{ end_it})) | |
constructs a non-dereferenceable sentinel iterator More... | |
auto | operator* () noexcept(noexcept(kblib::invoke(op, *it))) -> decltype(auto) |
Transforms the value obtained by dereferencing it. More... | |
decltype(auto) | operator* () const noexcept(noexcept(kblib::invoke(op, *it))) |
Transforms the value obtained by dereferencing it. More... | |
auto | operator-> () noexcept(noexcept(kblib::invoke(op, *it))) -> auto |
Returns a containing_ptr with the transformed value, because operator-> expects a pointer-like return type. More... | |
auto | operator-> () const noexcept(noexcept(kblib::invoke(op, *it))) -> auto |
Returns a containing_ptr with the transformed value, because operator-> expects a pointer-like return type. More... | |
auto | operator++ () noexcept(noexcept(++it)) -> transform_iterator & |
Increments the underlying iterator and returns *this. More... | |
auto | operator++ (int) noexcept(noexcept(transform_iterator{it++, op})) -> transform_iterator |
Increments the underlying iterator and returns a copy of the current value. More... | |
auto | base () const noexcept -> base_iterator |
auto | from_base (base_iterator it_) const noexcept(std::is_nothrow_copy_constructible_v< operation >) -> transform_iterator |
Friends | |
auto | operator== (const transform_iterator &lhs, const transform_iterator &rhs) noexcept -> bool |
Compares the base iterators of lhs and rhs. More... | |
auto | operator!= (const transform_iterator &lhs, const transform_iterator &rhs) noexcept -> bool |
Compares the base iterators of lhs and rhs. More... | |
template<typename OIt > | |
auto | operator== (const transform_iterator &lhs, const OIt &rhs) noexcept -> bool |
template<typename OIt > | |
auto | operator== (const OIt &lhs, const transform_iterator &rhs) noexcept -> bool |
template<typename OIt > | |
auto | operator!= (const transform_iterator &lhs, const OIt &rhs) noexcept -> bool |
template<typename OIt > | |
auto | operator!= (const OIt &lhs, const transform_iterator &rhs) noexcept -> bool |
An InputIterator that applies a transformation to the elements of the range.
Definition at line 1149 of file iterators.h.
using kblib::transform_iterator< base_iterator, operation >::const_result_type = decltype(kblib::invoke(std::as_const(op), *std::as_const(it))) |
Definition at line 1157 of file iterators.h.
using kblib::transform_iterator< base_iterator, operation >::difference_type = std::ptrdiff_t |
Definition at line 1155 of file iterators.h.
using kblib::transform_iterator< base_iterator, operation >::iterator_category = std::input_iterator_tag |
Definition at line 1162 of file iterators.h.
using kblib::transform_iterator< base_iterator, operation >::pointer = void |
Definition at line 1160 of file iterators.h.
using kblib::transform_iterator< base_iterator, operation >::reference = value_type |
Definition at line 1161 of file iterators.h.
using kblib::transform_iterator< base_iterator, operation >::result_type = decltype(kblib::invoke(op, *it)) |
Definition at line 1156 of file iterators.h.
using kblib::transform_iterator< base_iterator, operation >::value_type = result_type |
Definition at line 1159 of file iterators.h.
|
inlinenoexcept |
Constructs a transform_iterator which applies _op to the values obtained from *_it.
_it | An InputIterator to a range to be transformed. |
_op | The operation to apply to each element. |
Definition at line 1171 of file iterators.h.
|
inlinenoexcept |
constructs a non-dereferenceable sentinel iterator
end_it | An iterator that marks the end of the input range. |
Definition at line 1182 of file iterators.h.
|
inlinenoexcept |
Definition at line 1238 of file iterators.h.
|
inlinenoexcept |
Definition at line 1240 of file iterators.h.
|
inlinenoexcept |
Transforms the value obtained by dereferencing it.
Definition at line 1201 of file iterators.h.
|
inlinenoexcept |
Transforms the value obtained by dereferencing it.
Definition at line 1192 of file iterators.h.
|
inlinenoexcept |
Increments the underlying iterator and returns *this.
Definition at line 1223 of file iterators.h.
|
inlinenoexcept |
Increments the underlying iterator and returns a copy of the current value.
Definition at line 1233 of file iterators.h.
|
inlinenoexcept |
Returns a containing_ptr with the transformed value, because operator-> expects a pointer-like return type.
Definition at line 1216 of file iterators.h.
|
inlinenoexcept |
Returns a containing_ptr with the transformed value, because operator-> expects a pointer-like return type.
Definition at line 1209 of file iterators.h.
|
friend |
Definition at line 1279 of file iterators.h.
|
friend |
Definition at line 1274 of file iterators.h.
|
friend |
Compares the base iterators of lhs and rhs.
Definition at line 1257 of file iterators.h.
|
friend |
Definition at line 1268 of file iterators.h.
|
friend |
Definition at line 1263 of file iterators.h.
|
friend |
Compares the base iterators of lhs and rhs.
Definition at line 1249 of file iterators.h.