Re: [PATCH 2/2] libstdc++: Directly implement ranges::sort [PR100795]

2025-06-12 Thread Patrick Palka
     +    template > > _Proj> > > > >       +      constexpr void > > > >       +      __introsort_loop(_Iter __first, _Iter __last, > > > unsigned __depth_limit, > > > >       +                      _Comp __comp, _Proj __proj) > >

Re: [PATCH 2/2] libstdc++: Directly implement ranges::sort [PR100795]

2025-06-12 Thread Patrick Palka
   +                                                              > >  __comp, __proj); > > >       +           __detail::__introsort_loop(__cut, __last, > > __depth_limit, __comp, __proj); > > >       +           __last = __cut; > > &g

Re: [PATCH 2/2] libstdc++: Directly implement ranges::sort [PR100795]

2025-06-12 Thread Patrick Palka
            operator()(_Iter __first, _Sent __last, > >                        _Comp __comp = {}, _Proj __proj = {}) const > >              { > >       -       auto __lasti = ranges::next(__first, __last); > >       -       _GLIBCXX_STD_A::sort(std

Re: [PATCH 2/2] libstdc++: Directly implement ranges::sort [PR100795]

2025-06-12 Thread Patrick Palka
gt; + > >    struct __sort_fn > >    { > >      template _Sent, > > @@ -2175,10 +2354,33 @@ namespace ranges > >        operator()(_Iter __first, _Sent __last, > >                  _Comp __comp = {}, _Proj __proj = {}) const >

Re: [PATCH 2/2] libstdc++: Directly implement ranges::sort [PR100795]

2025-06-12 Thread Tomasz Kaminski
@@ namespace ranges > > operator()(_Iter __first, _Sent __last, > > _Comp __comp = {}, _Proj __proj = {}) const > > { > > - auto __lasti = ranges::next(__first, __last); > > - _GLIBCXX_

Re: [PATCH 2/2] libstdc++: Directly implement ranges::sort [PR100795]

2025-06-12 Thread Patrick Palka
__first != __last) > +             { > +               auto __n = __detail::__to_unsigned_like(__last - > __first); > +               unsigned __log_n; > +               if constexpr (is_class_v>) > +                 { > +               

Re: [PATCH 2/2] libstdc++: Directly implement ranges::sort [PR100795]

2025-06-11 Thread Tomasz Kaminski
On Tue, Jun 10, 2025 at 3:08 AM Patrick Palka wrote: > As with the previous patch, this patch reimplements ranges::sort > directly instead of incorrectly forwarding to std::sort. In addition to > the compatibility changes listed in the previous patch we also: > > - use ranges::iter_swap instea

Re: [PATCH 2/2] libstdc++: Directly implement ranges::sort [PR100795]

2025-06-10 Thread Patrick Palka
On Mon, 9 Jun 2025, Patrick Palka wrote: > As with the previous patch, this patch reimplements ranges::sort > directly instead of incorrectly forwarding to std::sort. In addition to > the compatibility changes listed in the previous patch we also: > > - use ranges::iter_swap instead of std::it

[PATCH 2/2] libstdc++: Directly implement ranges::sort [PR100795]

2025-06-09 Thread Patrick Palka
As with the previous patch, this patch reimplements ranges::sort directly instead of incorrectly forwarding to std::sort. In addition to the compatibility changes listed in the previous patch we also: - use ranges::iter_swap instead of std::iter_swap - use ranges::move_backward instead of std