Skip to content

<algorithm>: Fix bogus pointer arithmetic with integer-class - #5091

Merged
Stephan T. Lavavej (StephanTLavavej) merged 4 commits into
microsoft:mainfrom
frederick-vs-ja:stable_sort-integer-class
Nov 19, 2024
Merged

<algorithm>: Fix bogus pointer arithmetic with integer-class#5091
Stephan T. Lavavej (StephanTLavavej) merged 4 commits into
microsoft:mainfrom
frederick-vs-ja:stable_sort-integer-class

Conversation

@frederick-vs-ja

@frederick-vs-ja A. Jiang (frederick-vs-ja) commented Nov 16, 2024

Copy link
Copy Markdown
Contributor

By using ptrdiff_t when the related value is guaranteed to be small enough and/or used in pointer arithmetic. Fixes #2885.

@frederick-vs-ja
A. Jiang (frederick-vs-ja) requested a review from a team as a code owner November 16, 2024 09:24
@CaseyCarter Casey Carter (CaseyCarter) added bug Something isn't working ranges C++20/23 ranges labels Nov 16, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just some tweaks that I'll apply.

Comment thread stl/inc/algorithm Outdated
Comment thread tests/std/tests/GH_002885_stable_sort_difference_type/test.cpp
Comment thread stl/inc/algorithm Outdated
@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit fec1c8b into microsoft:main Nov 19, 2024
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for fixing this bogus journey and making the STL most triumphant! 🎸 👨‍🎤 ⏱️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ranges C++20/23 ranges

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<algorithm>: ranges::stable_sort missing difference_type casting for pointer arithmetic

3 participants