5#ifndef INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_MOVE_ITERATOR_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_MOVE_ITERATOR_HPP_
34template <
typename Iterator>
38 "The underlying iterator must be at least an input iterator"
69 typename SfinaeIterator = Iterator,
97 typename OtherIterator,
101 : current_(source.
base()) {}
110 typename OtherIterator,
113 current_ = source.base();
135 arene::base::advance(current_, 1);
143 arene::base::advance(current_, 1);
154 "The underlying iterator must be at least a bidirectional iterator to decrement"
156 arene::base::advance(current_, -1);
166 "The underlying iterator must be at least a bidirectional iterator to decrement"
169 arene::base::advance(current_, -1);
183 "The underlying iterator must be at least a random access iterator for random access operations"
197 "The underlying iterator must be at least a random access iterator for random access operations"
199 arene::base::advance(current_, delta);
211 "The underlying iterator must be at least a random access iterator for random access operations"
225 "The underlying iterator must be at least a random access iterator for random access operations"
227 arene::base::advance(current_, -delta);
240 "The underlying iterator must be at least a random access iterator for random access operations"
243 return static_cast<reference>(current_[delta]);
257template <
typename Iterator1,
typename Iterator2>
259 return lhs.base() == rhs.base();
270template <
typename Iterator1,
typename Iterator2>
272 return !(lhs == rhs);
282template <
typename Iterator1,
typename Iterator2>
284 return lhs.base() < rhs.base();
293template <
typename Iterator1,
typename Iterator2>
304template <
typename Iterator1,
typename Iterator2>
315template <
typename Iterator1,
typename Iterator2>
329template <
typename Iterator1,
typename Iterator2>
331 ->
decltype(lhs.base() - rhs.base()) {
332 return lhs.base() - rhs.base();
341template <
typename Iterator>
352template <
typename Iterator>
provides a uniform interface to the properties of an iterator
Definition iterator_traits.hpp:90
An iterator adaptor that wraps another iterator such that dereferencing the wrapped iterator yields a...
Definition move_iterator.hpp:35
conditional_t< is_reference_v< typename iterator_traits< Iterator >::reference >, remove_reference_t< typename iterator_traits< Iterator >::reference > &&, typename iterator_traits< Iterator >::reference > reference
iterator reference type
Definition move_iterator.hpp:58
typename iterator_traits< Iterator >::difference_type difference_type
The difference type of the iterator.
Definition move_iterator.hpp:50
auto operator[](difference_type delta) const -> reference
Access the value at a specified offset from the current iterator.
Definition move_iterator.hpp:237
auto operator+=(difference_type delta) -> move_iterator &
Move the current iterator forwards by a specified amount.
Definition move_iterator.hpp:194
auto operator*() const -> reference
Dereference the iterator.
Definition move_iterator.hpp:125
Iterator iterator_type
The type of the underlying iterator.
Definition move_iterator.hpp:48
move_iterator(Iterator iter) noexcept(is_nothrow_copy_constructible_v< Iterator >)
Construct an iterator holding the specified value of the underlying iterator.
Definition move_iterator.hpp:76
typename iterator_traits< Iterator >::iterator_category iterator_category
iterator category tag type
Definition move_iterator.hpp:56
move_iterator() noexcept(is_nothrow_default_constructible_v< Iterator >)
Default construct the iterator, holding a default-constructed underlying iterator....
Definition move_iterator.hpp:71
typename iterator_traits< Iterator >::value_type value_type
iterator value type
Definition move_iterator.hpp:54
auto operator-(difference_type delta) const -> move_iterator
Obtain a new iterator referencing the value from moving the current iterator backwards by a specified...
Definition move_iterator.hpp:208
auto operator->() const -> pointer
Arrow dereference operator for accessing the referenced value.
Definition move_iterator.hpp:130
~move_iterator()=default
Default destructor.
auto base() const -> iterator_type
Retrieve the underlying iterator.
Definition move_iterator.hpp:119
auto operator=(move_iterator< OtherIterator > const &source) -> move_iterator &
Conversion assignment from another move iterator with a different type of underlying iterator....
Definition move_iterator.hpp:112
move_iterator(move_iterator const &)=default
Default copy constructor.
auto operator-=(difference_type delta) -> move_iterator &
Move the current iterator backwards by a specified amount.
Definition move_iterator.hpp:222
auto operator++(int) -> move_iterator
Postincrement operator. Increments the stored iterator.
Definition move_iterator.hpp:141
auto operator++() -> move_iterator &
Preincrement operator. Increments the stored iterator.
Definition move_iterator.hpp:134
auto operator--(int) -> move_iterator
Postdecrement operator. Decrements the stored iterator.
Definition move_iterator.hpp:163
auto operator--() -> move_iterator &
Predecrement operator. Decrements the stored iterator.
Definition move_iterator.hpp:151
move_iterator(move_iterator< OtherIterator > const &source)
Conversion constructor from another move iterator with a different type of underlying iterator....
Definition move_iterator.hpp:100
auto operator+(difference_type delta) const -> move_iterator
Obtain a new iterator referencing the value from moving the current iterator forwards by a specified ...
Definition move_iterator.hpp:180
Iterator pointer
iterator pointer type
Definition move_iterator.hpp:52
auto operator=(move_iterator &&) -> move_iterator &=default
Default move assignment operator.
auto operator=(move_iterator const &) -> move_iterator &=default
Default copy assignment operator.
move_iterator(move_iterator &&)=default
Default move constructor.
Public export header for the constraints subpackage.
constexpr bool is_random_access_iterator_v
Definition iterator_category_traits.hpp:332
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
constexpr bool is_input_iterator_v
Definition iterator_category_traits.hpp:259
constexpr bool is_bidirectional_iterator_v
Definition iterator_category_traits.hpp:312
auto operator<=(move_iterator< Iterator1 > const &lhs, move_iterator< Iterator2 > const &rhs) -> bool
Check if one iterator is less than or equal to another.
Definition move_iterator.hpp:294
auto operator>=(move_iterator< Iterator1 > const &lhs, move_iterator< Iterator2 > const &rhs) -> bool
Check if one iterator is greater than or equal to another.
Definition move_iterator.hpp:316
auto operator!=(move_iterator< Iterator1 > const &lhs, move_iterator< Iterator2 > const &rhs) -> bool
Check if two iterators are not equal.
Definition move_iterator.hpp:271
auto operator+(typename move_iterator< Iterator >::difference_type delta, move_iterator< Iterator > const &iter) -> move_iterator< Iterator >
Obtain a new iterator referencing the value from moving the specified iterator forwards by a specifie...
Definition move_iterator.hpp:342
auto operator<(move_iterator< Iterator1 > const &lhs, move_iterator< Iterator2 > const &rhs) -> bool
Check if one iterator is less than another.
Definition move_iterator.hpp:283
auto make_move_iterator(Iterator iter) -> std::move_iterator< Iterator >
Create a move_iterator with the specified underlying iterator.
Definition move_iterator.hpp:353
auto operator==(move_iterator< Iterator1 > const &lhs, move_iterator< Iterator2 > const &rhs) -> bool
Check if two iterators are equal.
Definition move_iterator.hpp:258
typename conditional< Condition, TrueType, FalseType >::type conditional_t
Helper template alias for selecting types based on a condition. If the supplied Condition is true the...
Definition conditional.hpp:57
constexpr bool is_nothrow_copy_constructible_v
Type trait to detect if an instance of T is copy constructible without throwing.
constexpr bool is_reference_v
Check if the supplied template argument is a reference or not. The value is true if so,...
auto operator-(move_iterator< Iterator1 > const &lhs, move_iterator< Iterator2 > const &rhs) ->
Obtain the distance between two iterators.
Definition move_iterator.hpp:330
typename remove_reference< T >::type remove_reference_t
An alias for T, but with top-level reference qualifiers removed.
Definition remove_reference.hpp:47
constexpr bool is_nothrow_default_constructible_v
Type trait to detect if an instance of T is default constructible without throwing.
auto operator>(move_iterator< Iterator1 > const &lhs, move_iterator< Iterator2 > const &rhs) -> bool
Check if one iterator is greater than another.
Definition move_iterator.hpp:305