|
constexpr | IndirectIterator (Iter iterator) noexcept(std::is_nothrow_move_constructible_v< Iter >) |
|
template<typename OtherIter , typename = std::enable_if_t<std::is_convertible_v<OtherIter, Iter>>> |
constexpr | IndirectIterator (IndirectIterator< OtherIter > iterator) noexcept(std::is_nothrow_move_constructible_v< Iter >) |
|
constexpr | IndirectIterator (const IndirectIterator &) noexcept(std::is_nothrow_copy_constructible_v< Iter >)=default |
|
constexpr IndirectIterator & | operator= (const IndirectIterator &) noexcept(std::is_nothrow_assignable_v< Iter, Iter >)=default |
|
constexpr | IndirectIterator (IndirectIterator &&) noexcept(std::is_nothrow_move_constructible_v< Iter >)=default |
|
constexpr IndirectIterator & | operator= (IndirectIterator &&) noexcept(std::is_nothrow_move_assignable_v< Iter >)=default |
|
constexpr IndirectIterator & | operator++ () |
|
constexpr IndirectIterator | operator++ (int) |
|
template<typename I = Iter, typename = require_t<std::bidirectional_iterator_tag, I>> |
constexpr IndirectIterator & | operator-- () |
|
template<typename I = Iter, typename = require_t<std::bidirectional_iterator_tag, I>> |
constexpr IndirectIterator | operator-- (int) |
|
template<typename I = Iter, typename = require_t<std::random_access_iterator_tag, I>> |
constexpr IndirectIterator & | operator+= (difference_type rhs) |
|
template<typename I = Iter, typename = require_t<std::random_access_iterator_tag, I>> |
constexpr IndirectIterator & | operator-= (difference_type rhs) |
|
template<typename I = Iter, typename = require_t<std::random_access_iterator_tag, I>> |
constexpr difference_type | operator- (const IndirectIterator &rhs) const |
|
template<typename I = Iter, typename = require_t<std::random_access_iterator_tag, I>> |
constexpr IndirectIterator | operator+ (difference_type i) const |
|
template<typename I = Iter, typename = require_t<std::random_access_iterator_tag, I>> |
constexpr IndirectIterator | operator- (difference_type i) const |
|
template<typename I = Iter, typename = require_t<std::random_access_iterator_tag, I>> |
constexpr reference | operator[] (difference_type i) const |
|
constexpr reference | operator* () const |
|
constexpr pointer | operator-> () const |
|
constexpr const Iter & | base () const & |
|
constexpr Iter & | base () & |
|
constexpr Iter | base () && |
|
constexpr bool | operator== (const IndirectIterator &rhs) const |
|
constexpr bool | operator!= (const IndirectIterator &rhs) const |
|
template<typename I = Iter, typename = require_t<std::random_access_iterator_tag, I>> |
constexpr bool | operator> (const IndirectIterator &rhs) const |
|
template<typename I = Iter, typename = require_t<std::random_access_iterator_tag, I>> |
constexpr bool | operator< (const IndirectIterator &rhs) const |
|
template<typename I = Iter, typename = require_t<std::random_access_iterator_tag, I>> |
constexpr bool | operator>= (const IndirectIterator &rhs) const |
|
template<typename I = Iter, typename = require_t<std::random_access_iterator_tag, I>> |
constexpr bool | operator<= (const IndirectIterator &rhs) const |
|
template<typename Iter, bool PropagateConst = true>
struct inviwo::util::IndirectIterator< Iter, PropagateConst >
IndirectIterator<typename Iter, bool PropagateConst = true> Iter is underlying iterator to a pointer like type PropagateConst decides if we should treat the value as const if the pointer is const.
Example:
std::vector<std::unique_ptr<int>> vec;
for (int i = 0; i < 5; ++i) {
vec.push_back(std::make_unique<int>(i));
}
*it = 5;
*const_it = 5;
*mutable_it = 5;
IndirectIterator< Iter, PropagateConst > makeIndirectIterator(Iter iter) noexcept(std::is_nothrow_move_constructible_v< Iter >)
Definition indirectiterator.h:271
The use case is to container types that stores items using a vector of pointers, but want to expose an iterator directly to the item not to the pointer.
- See also
- makeIndirectIterator