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

<algorithm>: Relax const-ness requirements on ranges::_Meow_bound_unchecked #4927

Merged

Conversation

frederick-vs-ja
Copy link
Contributor

Fixes #4863.


I guess it would be better to require const& for the checking in std::sortable to make ranges::inplace_merge able to use ranges::upper_bound like this:

template<dereferenceable I>
  struct const_lvalue_adaptor { // exposition only
    const iter_reference_t<I>& operator*(); // not defined
  };

template<class I, class R = ranges::less, class P = identity>
  concept sortable =
    permutable<I> &&
    indirect_strict_weak_order<R, const_lvalue_adaptor<projected<I, P>>>;

But at this moment I decide just not to require const& for internal checking.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner September 1, 2024 17:54
@StephanTLavavej StephanTLavavej added bug Something isn't working ranges C++20/23 ranges labels Sep 1, 2024
@StephanTLavavej StephanTLavavej self-assigned this Sep 2, 2024
@StephanTLavavej
Copy link
Member

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

@StephanTLavavej StephanTLavavej merged commit 1a54b61 into microsoft:main Sep 4, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

Thanks for fixing these compiler errors! 🛠️ 🪄 😻

@frederick-vs-ja frederick-vs-ja deleted the inplace_merge-bounds-checking branch September 4, 2024 05:56
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
Archived in project
Development

Successfully merging this pull request may close these issues.

<algorithm>: ranges::inplace_merge doesn't seem to be able to utilize ranges::upper_bound
3 participants