Skip to content

fix unit-algorithms test reliance on implementation specific behaviour - #5236

Merged
nlohmann merged 1 commit into
nlohmann:developfrom
pauldreik:develop
Jul 6, 2026
Merged

fix unit-algorithms test reliance on implementation specific behaviour#5236
nlohmann merged 1 commit into
nlohmann:developfrom
pauldreik:develop

Conversation

@pauldreik

Copy link
Copy Markdown
Contributor

the standard only specifies that the first elements are sorted after invoking std::partial_sort.

quoting cppreference:

The order of equal elements is not guaranteed to be preserved. The order of the remaining elements in the range [middle, last) is unspecified.

I agree with the Developer Certificate of Origin Version 1.1.

Comment thread tests/src/unit-algorithms.cpp Fixed
the standard only specifies that the first elements are sorted.

this caused my experimental C++ standard library implementation to fail.

Signed-off-by: Paul Dreik <github@pauldreik.se>
Comment thread tests/src/unit-algorithms.cpp Dismissed

@nlohmann nlohmann left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks good to me.

@nlohmann nlohmann added this to the Release 3.12.1 milestone Jul 5, 2026
@nlohmann

nlohmann commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Thanks a lot!

@nlohmann
nlohmann merged commit 33edc97 into nlohmann:develop Jul 6, 2026
154 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants