Open hewillk opened 5 days ago
Additionally, range-version APIs should not dispatch to the
std::moew
algorithm which only works with C++98 iterators.
This shouldn't be an issue after implementing P2408R5 (tracked in #105211). I think we should implement P2408R5 in C++20 mode like MSVC STL.
Additionally, range-version APIs should not dispatch to the
std::moew
algorithm which only works with C++98 iterators.This shouldn't be an issue after implementing P2408R5 (tracked in #105211). I think we should implement P2408R5 in C++20 mode like MSVC STL.
Why is it not an issue? As far as I know, that paper is mainly about forward_iterator
not input_iterator
.
Additionally, range-version APIs should not dispatch to the
std::moew
algorithm which only works with C++98 iterators.This shouldn't be an issue after implementing P2408R5 (tracked in #105211). I think we should implement P2408R5 in C++20 mode like MSVC STL.
Why is it not an issue? As far as I know, that paper is mainly about
forward_iterator
notinput_iterator
.
I see. Currently, __insert_with_size
doesn't properly work with input-only ranges because it possibly traverses a subrange more than once. We need to carve out the input-only-but-sized cases first, and the rest will be resolved together with P2408R5.
and the rest will be resolved together with P2408R5
Not true. I must had forgotten something. Per [sequence.reqmts]/36, IIUC both the old iterator-pair insert
and the new insert_range
are not suppose to directly assign any container element from the source range, except when the assignment happens to be move assignment of the value_type
.
I.e. the old iterator-pair insert
is almost equivalently misimplemented.
This seems like a duplicate of #47963.
https://github.com/llvm/llvm-project/blob/de2fad32513f7420988df1cf99aff90e0a067469/libcxx/include/__vector/vector.h#L1317
Unlike
assign_range
which requiresassignable_from<T&, ranges::range_reference_t<R>>
, this means thatstd::copy
is not necessarily well-formed forinsert_range
:https://godbolt.org/z/jo3vjjo5b
Additionally, range-version APIs should not dispatch to the
std::moew
algorithm which only works with C++98 iterators.