Remove algo duplication

François Dumont frs.dumont@gmail.com
Mon Sep 9 19:41:00 GMT 2013


On 09/08/2013 04:33 PM, Marc Glisse wrote:
> On Tue, 3 Sep 2013, François Dumont wrote:
>
>>    I still have this patch pending on my side, I don't think we ever 
>> really decided what to do with it. In this version of the patch 
>> everything not Standard has been moved to the std::__detail namespace 
>> for a cleaner design.
>
> Argh, that makes the patch much harder to read (irrelevant __detail 
> changes all over the place), in the future please avoid mixing things.

Yes, I try to make the patch more sexy for adoption but it is indeed 
harder to read. Let me split it with the move of implementation details 
to __detail first and then the refactoring. Move to __detail will have 
more chance to be accepted I think and it will give me some time to 
think about the second part of this mail.

>
> +  template<typename _Iterator1, typename _Iterator2 = _Iterator1>
> +    struct _Iter_less_iter
> +    {
> +      bool
> +      operator()(_Iterator1 __it1, _Iterator2 __it2)
> +      { return *__it1 < *__it2; }
> +    };
>
> I don't remember if we already discussed it, but why not this instead?
>
> +    struct _Iter_less_iter
> +    {
> +      template<typename _Iterator1, typename _Iterator2>
> +      bool
> +      operator()(_Iterator1 __it1, _Iterator2 __it2) const
> +      { return *__it1 < *__it2; }
> +    };
>
I don't remember this proposal so I will give it a try.

François



More information about the Libstdc++ mailing list