Improve std::rotate usages
Jonathan Wakely
jwakely@redhat.com
Tue Aug 7 14:12:00 GMT 2018
On 27/05/18 19:25 +0200, François Dumont wrote:
>Still no chance to review it ?
>
>I'd like this one to go in before submitting other algo related patches.
>
>Â Â Â * include/bits/stl_algo.h
>Â Â Â (__rotate(_Ite, _Ite, _Ite, forward_iterator_tag))
>Â Â Â (__rotate(_Ite, _Ite, _Ite, bidirectional_iterator_tag))
>Â Â Â (__rotate(_Ite, _Ite, _Ite, random_access_iterator_tag)): Move
>code duplication...
>Â Â Â (rotate(_Ite, _Ite, _Ite)): ...here.
>Â Â Â (__stable_partition_adaptive(_FIt, _FIt, _Pred, _Dist, _Pointer,
>_Dist)):
>Â Â Â Simplify rotate call.
>Â Â Â (__rotate_adaptive(_BIt1, _BIt1, _BIt1, _Dist, _Dist, _Bit2, _Dist)):
>Â Â Â Likewise.
>Â Â Â (__merge_without_buffer(_BIt, _BIt, _BIt, _Dist, _Dist, _Comp)):
>Â Â Â Likewise.
>
>François
>
>On 14/05/2018 22:14, François Dumont wrote:
>>Any feedback regarding this patch ?
>>
>>
>>On 02/05/2018 07:26, François Dumont wrote:
>>>Hi
>>>
>>>Â Â Â std::rotate already returns the expected iterator so there is
>>>no need for calls to std::advance/std::distance.
Yes, looks like that code predated DR 488 which changed the return
type of std::rotate.
OK for trunk, thanks.
More information about the Libstdc++
mailing list