[libcxx-commits] [PATCH] D125608: [libc++] Implement ranges::is_sorted{, _until}
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sun May 15 08:40:53 PDT 2022
philnik added inline comments.
================
Comment at: libcxx/include/__algorithm/ranges_is_sorted.h:46
+ __comp,
+ __proj) == ranges::end(__range);
+ }
----------------
Mordante wrote:
> This looks sensible, however it seems the Standard doesn't specify this overload. Is there an LWG issue?
I'm not sure what you mean. It's both in the current standard and in the one ranges proposal. Did you just miss it? It's right after http://eel.is/c++draft/alg.sort#is.sorted-4.
================
Comment at: libcxx/include/__algorithm/ranges_is_sorted_until.h:44
+ }
+ return std::move(__i);
+}
----------------
Mordante wrote:
> The move semantics in this function are inconsistent and wrong in some places.
> `while (++__i != __last)` uses a moved from iterator.
> one return moves, the other doesn't. Why move in the return, a `forward_iterator` is copyable.
Idk. I must have thought these are `input_iterator`s for some reason.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125608/new/
https://reviews.llvm.org/D125608
More information about the libcxx-commits
mailing list