First patch to simplify <algorithm>

Paolo Carlini pcarlini@suse.de
Sun Dec 5 14:54:00 GMT 2004


Gabriel Dos Reis wrote:

>I have a slight preference for 
>
>  (1) putting the stuff in __gnu_cxx::
>  (2) using standard names, e.g. equal, less, greater, ...
>      They are already reserved for implementation.
>  (3) making the operator a member template, instead of parameterizing
>      the whole class; they should be const-members.
>
>E.g.
>
>   namespace __gnu_cxx 
>   {
>      struct less {
>         template<class _Tp1, class _Tp2>   
>           bool operator()(const _Tp1& __lrhs, const _Tp2& __rhs) const
>           { return __lhs < __rhs; }
>   }
>  
>
Of course I agree with everything (indeed the final result is *so* 
nice!) but...

>There might arise some issues with associated types, though they are
>easily dealt with.
>  
>
... could you please clarify a bit this final note?

Thanks,
Paolo.



More information about the Libstdc++ mailing list