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: Implementing normal algorithms using predicate versions


Paolo Carlini <pcarlini@suse.de> writes:

| chris wrote:
| 
| > I was intending on using something like (warning: away from C++
| > compiler, I haven't even compiled this code!)
| >
| > template<typename __T1, typename __T2>
| > struct __default_predicate {
| > bool
| > operator()(const __T1& __t1, const __T2& __t2) { return __t1<__t2;}
| > };
| 
| Ah, yes, this - or slight variations - look good. Maybe we should
| discuss a bit
| more the optimization thing and then, possibly, actually implement the idea
| in v7... :)

I see it more as a good code organization than optimization :-)
But, yes I'm for anything sensible along that line that reduces code
duplication.  I already discussed the idea with Benjamin (back in
October 2002) and he was quite positive about it.  It did not happen
because I did not submit the full patch, but if you can over that that
is great! :-)

-- Gaby


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