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 |
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 1148 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 1156 of file iterators.h.
using kblib::transform_iterator< base_iterator, operation >::difference_type = std::ptrdiff_t |
Definition at line 1154 of file iterators.h.
using kblib::transform_iterator< base_iterator, operation >::iterator_category = std::input_iterator_tag |
Definition at line 1161 of file iterators.h.
using kblib::transform_iterator< base_iterator, operation >::pointer = void |
Definition at line 1159 of file iterators.h.
using kblib::transform_iterator< base_iterator, operation >::reference = value_type |
Definition at line 1160 of file iterators.h.
using kblib::transform_iterator< base_iterator, operation >::result_type = decltype(kblib::invoke(op, *it)) |
Definition at line 1155 of file iterators.h.
using kblib::transform_iterator< base_iterator, operation >::value_type = result_type |
Definition at line 1158 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 1170 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 1181 of file iterators.h.
|
inlinenoexcept |
Definition at line 1237 of file iterators.h.
|
inlinenoexcept |
Transforms the value obtained by dereferencing it.
Definition at line 1200 of file iterators.h.
|
inlinenoexcept |
Transforms the value obtained by dereferencing it.
Definition at line 1191 of file iterators.h.
|
inlinenoexcept |
Increments the underlying iterator and returns *this.
Definition at line 1222 of file iterators.h.
|
inlinenoexcept |
Increments the underlying iterator and returns a copy of the current value.
Definition at line 1232 of file iterators.h.
|
inlinenoexcept |
Returns a containing_ptr with the transformed value, because operator-> expects a pointer-like return type.
Definition at line 1215 of file iterators.h.
|
inlinenoexcept |
Returns a containing_ptr with the transformed value, because operator-> expects a pointer-like return type.
Definition at line 1208 of file iterators.h.
|
friend |
Definition at line 1272 of file iterators.h.
|
friend |
Definition at line 1267 of file iterators.h.
|
friend |
Compares the base iterators of lhs and rhs.
Definition at line 1250 of file iterators.h.
|
friend |
Definition at line 1261 of file iterators.h.
|
friend |
Definition at line 1256 of file iterators.h.
|
friend |
Compares the base iterators of lhs and rhs.
Definition at line 1242 of file iterators.h.