This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++20 status.
3389. A move-only iterator still does not have acounted_iterator
Section: 24.5.7.2 [counted.iter.const] Status: C++20 Submitter: Patrick Palka Opened: 2020-02-07 Last modified: 2021-02-25
Priority: 0
View all issues with C++20 status.
Discussion:
P1207R4 ("Movability of single-pass iterators") introduces the notion of a move-only non-forward iterator and makes some changes to the iterator adaptor counted_iterator
in order to support move-only iterators.
counted_iterator
(24.5.7.2 [counted.iter.const] p2) accepting such an iterator is specified as "Initializes current
with i
" which would attempt copy-constructing current
from i
instead of move-constructing it.
[2020-02 Prioritized as IMMEDIATE Monday morning in Prague]
Proposed resolution:
This wording is relative to N4849.
Modify 24.5.7.2 [counted.iter.const] as indicated:
constexpr counted_iterator(I i, iter_difference_t<I> n);-1- Preconditions:
-2- Effects: Initializesn >= 0
.current
withstd::move(i )
andlength
withn
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4