Skip to content
Commit 207d4be4 authored by Arthur O'Dwyer's avatar Arthur O'Dwyer
Browse files

[libc++] [P0879] constexpr std::nth_element, and rewrite its tests.

This patch is more than just adding the `constexpr` keyword, because
the old code relied on `goto`, and `goto` is not constexpr-friendly.
Refactor to eliminate `goto`, and then mark it as constexpr in C++20.

I freely admit that the name `__nth_element_partloop` is bad;
I couldn't find any better name because I don't really know
what this loop is doing, conceptually. Vice versa, I think
`__nth_element_find_guard` has a decent name.

Now the only one we're still missing from P0879 is `sort`.

Differential Revision: https://reviews.llvm.org/D93557
parent 9cbef8c9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment