[libcxx-commits] [PATCH] D128744: [libc++][ranges] Implement `ranges::partial_sort`.

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 19 18:21:07 PDT 2022


var-const added inline comments.


================
Comment at: libcxx/include/__algorithm/partial_sort.h:93-94
 {
-    _VSTD::partial_sort(__first, __middle, __last,
-                        __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
+  std::partial_sort(std::move(__first), std::move(__middle), std::move(__last),
+      __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
 }
----------------
philnik wrote:
> Could you either not move these or `static_assert` that they are copy-constructible and copy-assignable to avoid portability problems?
Ah, this is a very good catch. Added static assertions and added auditing those to my backlog.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128744/new/

https://reviews.llvm.org/D128744



More information about the libcxx-commits mailing list