Enable bidirectional optimization for non-common ranges in std::ranges::partition by mirion-dev · Pull Request #5887 · microsoft/STL (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@mirion-dev

@mirion-dev

@frederick-vs-ja

I think it's better to remove the issue number from the PR title. Things will be confusing if it goes into squashed commit message.

@mirion-dev mirion-dev changed the titleEnable bidirectional optimization for non-common ranges in std::ranges::partition (Fixes #5886) Enable bidirectional optimization for non-common ranges in std::ranges::partition

Nov 20, 2025

@vmichal

Hi, just for completeness, this PR is not set to close the corresponding issue #5886 on merge.
I'd say it would help the PR process to indicate that properly (if you are certain the PR actually solves the issue, ofc. It looks good to me).

@mirion-dev

Hi, just for completeness, this PR is not set to close the corresponding issue #5886 on merge. I'd say it would help the PR process to indicate that properly (if you are certain the PR actually solves the issue, ofc. It looks good to me).

Hi, thanks for the reminder! I've updated the description. I actually wasn't aware of the auto-close feature.

StephanTLavavej

@StephanTLavavej

Thanks! 😻 I verified with a static_assert that we have existing test coverage for bidi-but-not-common ranges in libcxx std/algorithms/alg.modifying.operations/alg.partitions/ranges_partition.pass.cpp and std P0896R4_ranges_alg_partition.

@StephanTLavavej

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

@StephanTLavavej

Thanks for optimizing this ranges algorithm, and congratulations on your first microsoft/STL commit! 🎉 😸 🚀

Labels

bug

Something isn't working

ranges

C++20/23 ranges