Issue 4705

Kagamin spam at here.lot
Mon Sep 19 04:12:58 PDT 2011


Andrei Alexandrescu Wrote:

> On 9/16/11 4:33 AM, Kagamin wrote:
> > Jonathan M Davis Wrote:
> >
> >> I think that that's up for debate. I would fully expect a min/max function to
> >> be using a comparator function, which means using a binary predicate.
> >
> > 1. how would they treat the function?
> > 2. do you have a use case for a binary predicate?
> 
> I was thinking along the lines of e.g. icmp(a, b) < 0 for a 
> case-insensitive compare. I don't know offhand how to do the same with a 
> mapper without copying strings.

OK, one use case. I suppose this is needed rarely so it can be factored to another function or idiom. BTW case-insensitive comparison is a good candidate to be built into the underlying collection, e.g. AA.


More information about the Digitalmars-d mailing list