[libcxx-commits] [PATCH] D128115: [libc++][ranges] Implement modifying heap algorithms:

Hui via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 28 07:25:03 PDT 2022


huixie90 added inline comments.


================
Comment at: libcxx/include/__algorithm/pop_heap.h:33
+  if (__len > 1) {
+    value_type __top = std::move(*__first);  // create a hole at __first
+    _RandomAccessIterator __hole = std::__floyd_sift_down<_Compare>(__first, __comp, __len);
----------------
var-const wrote:
> huixie90 wrote:
> > I believe this needs to call `ranges::iter_move` for the ranges version
> Thanks _a lot_ for finding this! I'd prefer to address this for all recently-implemented algorithms in a follow-up patch -- would that work for you?
Yes. sounds good to me. 
I am going to create a test utility which adapts our existing test_iterators, and simulate the proxy iterator behaviour (like zip iterator). and all permutation algorithms would test against these kinds of iterators


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128115



More information about the libcxx-commits mailing list