13#ifndef RANGES_V3_ITERATOR_MOVE_ITERATORS_HPP
14#define RANGES_V3_ITERATOR_MOVE_ITERATORS_HPP
25#include <range/v3/detail/prologue.hpp>
39 using iterator_type = I;
40 using difference_type = iter_difference_t<I>;
41 using value_type = iter_value_t<I>;
42 using iterator_category = std::input_iterator_tag;
43 using reference = iter_rvalue_reference_t<I>;
50 requires convertible_to<O, I>)
55 requires convertible_to<O, I>)
66 auto CPP_auto_fun(
operator*)()(
const)
68 return iter_move(current_)
107 auto operator+(difference_type n)
const
114 auto operator+=(difference_type n)
122 auto operator-(difference_type n)
const
129 auto operator-=(difference_type n)
137 auto operator[](difference_type n)
const
138 -> CPP_ret(reference)(
141 return iter_move(current_ + n);
144 template<
typename I2>
146 -> CPP_broken_friend_ret(
bool)(
147 requires equality_comparable_with<I, I2>)
149 return x.base() == y.base();
151 template<
typename I2>
153 -> CPP_broken_friend_ret(
bool)(
154 requires equality_comparable_with<I, I2>)
158 template<
typename I2>
160 -> CPP_broken_friend_ret(
bool)(
161 requires totally_ordered_with<I, I2>)
163 return x.base() < y.base();
165 template<
typename I2>
167 -> CPP_broken_friend_ret(
bool)(
168 requires totally_ordered_with<I, I2>)
172 template<
typename I2>
174 -> CPP_broken_friend_ret(
bool)(
175 requires totally_ordered_with<I, I2>)
179 template<
typename I2>
181 -> CPP_broken_friend_ret(
bool)(
182 requires totally_ordered_with<I, I2>)
187 template<
typename I2>
189 -> CPP_broken_friend_ret(iter_difference_t<I2>)(
192 return x.base() - y.base();
195 friend auto operator+(iter_difference_t<I> n,
206 template(
typename I)(
227 : sent_(detail::move(s))
229 template(
typename OS)(
230 requires convertible_to<OS, S>)
234 template(
typename OS)(
235 requires convertible_to<OS, S>)
248 -> CPP_broken_friend_ret(
bool)(
251 return i.base() == s.base();
255 -> CPP_broken_friend_ret(
bool)(
258 return s.base() == i.base();
262 -> CPP_broken_friend_ret(
bool)(
265 return i.base() != s.base();
269 -> CPP_broken_friend_ret(
bool)(
272 return s.base() != i.base();
278 template(
typename I)(
285 template(
typename S)(
298 template<
typename I,
bool IsReadable>
299 struct move_into_cursor_types_
303 struct move_into_cursor_types_<I, true>
305 using value_type = iter_value_t<I>;
306 using single_pass =
meta::bool_<(bool)single_pass_iterator_<I>>;
310 using move_into_cursor_types =
311 move_into_cursor_types_<I, (bool)indirectly_readable<I>>;
314 struct move_into_cursor : move_into_cursor_types<I>
318 struct mixin : basic_mixin<move_into_cursor>
322 using basic_mixin<move_into_cursor>::basic_mixin;
324 constexpr explicit mixin(move_into_cursor && cur)
325 : basic_mixin<move_into_cursor>(static_cast<move_into_cursor &&>(cur))
327 constexpr explicit mixin(move_into_cursor
const & cur)
328 : basic_mixin<move_into_cursor>(cur)
332 : mixin{move_into_cursor{std::move(it)}}
336 return this->get().it_;
342 explicit move_into_cursor(I it)
349 template(
typename T)(
350 requires indirectly_writable<I, aux::move_t<T>>)
351 void write(T && t)
noexcept(
noexcept(*it_ = std::move(t)))
355 template(
typename T)(
356 requires indirectly_writable<I, aux::move_t<T>>)
357 void write(T && t)
const noexcept(
noexcept(*it_ = std::move(t)))
362 auto read() const noexcept(noexcept(*std::declval<I const &>()))
363 -> CPP_ret(iter_reference_t<I>)(
364 requires indirectly_readable<I>)
369 auto equal(move_into_cursor
const & that)
const
371 requires input_iterator<I>)
373 return it_ == that.it_;
378 requires bidirectional_iterator<I>)
383 auto advance(iter_difference_t<I> n)
385 requires random_access_iterator<I>)
390 auto distance_to(move_into_cursor
const & that)
const
391 -> CPP_ret(iter_difference_t<I>)(
392 requires sized_sentinel_for<I, I>)
394 return that.it_ - it_;
396 template(
typename II = I
const)(
397 requires same_as<I const, II> AND indirectly_readable<II>)
398 constexpr iter_rvalue_reference_t<II> move() const
399 noexcept(has_nothrow_iter_move_v<II>)
401 return iter_move(it_);
405 constexpr move_into_cursor() =
default;
424 using ranges::make_move_iterator;
432RANGES_DIAGNOSTIC_PUSH
433RANGES_DIAGNOSTIC_IGNORE_MISMATCHED_TAGS
438 struct iterator_traits<::ranges::move_iterator<I>>
440 using iterator_category = std::input_iterator_tag;
441 using difference_type = typename ::ranges::move_iterator<I>::difference_type;
442 using value_type = typename ::ranges::move_iterator<I>::value_type;
443 using reference = typename ::ranges::move_iterator<I>::reference;
451#include <range/v3/detail/epilogue.hpp>
The bidirectional_iterator concept.
The forward_iterator concept.
The random_access_iterator concept.
The sentinel_for concept.
The sized_sentinel_for concept.
#define CPP_broken_friend_member
INTERNAL ONLY.
Definition concepts.hpp:447
std::integral_constant< bool, B > bool_
An integral constant wrapper for bool.
Definition meta.hpp:168
typename T::type _t
Type alias for T::type.
Definition meta.hpp:141
Definition basic_iterator.hpp:532
Definition move_iterators.hpp:205
Definition move_iterators.hpp:277
Definition move_iterators.hpp:411
Definition move_iterators.hpp:33
Definition move_iterators.hpp:218