This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: First patch to simplify <algorithm>


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]