Safer casts

Dee Girl deegirl at noreply.com
Tue May 13 00:47:36 PDT 2008


Janice Caron Wrote:

> 2008/5/13 Sean Kelly <sean at invisibleduck.org>:
> >  It depends what you mean by "powerful."  Passing a comparator as a template parameter,
> >  as with sort!(), means that the choice of comparator must be made at compile-time rather
> >  than run-time.  This may be problematic in some instances.
> 
> I think you meant to say, the choice of comparator /may/ be made at
> compile-time. Not must.
> 
>     sort!(compare)(array); // compile time
>     sort(compare, array); // run time

Even more simple.

sort!(compare)(array);
sort!(compare)(array);

Decision depends on what compare is. Dee Girl



More information about the Digitalmars-d mailing list