Skip to content

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.

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)?

@PaulXiCao PaulXiCao force-pushed the constexpr_stable_sort branch from acaea71 to 55c19d3 Compare September 21, 2024 01:47
@PaulXiCao PaulXiCao closed this Dec 19, 2024
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