Skip to content

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