[v3] Remove algos code duplication

Paolo Carlini paolo.carlini@oracle.com
Mon Mar 26 09:59:00 GMT 2012


Hi,
> On Sun, 25 Mar 2012, Daniel KrÃŒgler wrote:
>
>> Am 25. MÀrz 2012 22:13 schrieb Marc Glisse <marc.glisse@inria.fr>:
>>> - is there anything wrong with std::less?
>>
>> Unfortunately yes: User-code can independently specialize std::less, so
>> this could cause an observable difference. During concept time Doug
>> Gregor suggested to simplify the library specification in that way, 
>> but the
>> committee could not agree on that because of this observability problem.
>
> Thank you for those precisions.
>
> So using std::__less would be fine (a non-specializable class that 
> std::less derives from by default). Or std::__generic_less (with the 
> template parameters on the operator, not the class).
I suppose we want to start from the work Chris did in the 
libstdcxx_so_7-branch (thus, in practice, predefined_ops.h, etc) and 
re-analyze those old discussions (with Howard's participation too) about 
making sure not breaking the algos vs proxy iterators. I suppose modern 
C++11 facilities, in terms of perfect forwarding for example, could well 
make the task easier.

Thanks,
Paolo.



More information about the Libstdc++ mailing list