[libcxx-commits] [PATCH] D118003: [libc++] Floyd's improvement to pop_heap

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 8 19:57:28 PST 2022


EricWF added inline comments.


================
Comment at: libcxx/include/__algorithm/sift_down.h:83
+    using difference_type = typename iterator_traits<_RandomAccessIterator>::difference_type;
+    _LIBCPP_ASSERT(__len >= 2, "shouldn't be called unless __len >= 2");
+
----------------
Quuxplusone wrote:
> EricWF wrote:
> > LIBCPP_ASSERT is not meant to guard against internal library logic errors. 
> You (or anyone) got any better suggestions? Should this just be a comment `// __len >= 2 at this point`?
Write a test that would fail were this to be called (failing only under ASAN or MSAN is fine).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118003



More information about the libcxx-commits mailing list