Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc++][C++26] constexpr std::stable_sort (part of P2562) #105379

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

PaulXiCao
Copy link
Contributor

As of P2562 / C++26 std::stable_sort is constexpr. The paper is available here: https://wg21.link/p2562 .

It contains other functions that should be made constexpr as well. (I might work on them later on. Either appending them to this pr or creating separate ones.)

Regarding testing: I refactored the original tests, used some of them for testing the constexpr functionality, and also created tests for the "stable" part of std::stable_sort (i.e. search for stability_test in the test file).

@frederick-vs-ja
Copy link
Contributor

FYI I'm trying a different approach in #100914 - which should allow adding _LIBCPP_CONSTEXPR_SINCE_CXX26 directly.

@@ -67,7 +67,7 @@ template <class _AlgPolicy,
class _InputIterator2,
class _Sent2,
class _OutputIterator>
_LIBCPP_HIDE_FROM_ABI void __half_inplace_merge(
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 void __half_inplace_merge(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not _LIBCPP_CONSTEXPR_SINCE_CXX26 (ditto below)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants