auto ref function parameters in a free function

Artur Skawina via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Aug 3 14:46:51 PDT 2014


On 08/03/14 23:19, Vlad Levenfeld via Digitalmars-d-learn wrote:
> 
> I made less_than to serve as a default sorting predicate, so in a few places there is something like this:
> 
> void sort (R, T = ElementType!R, alias compare = less_than!T)(R range, T item)
> {...}

 void sort (R, T = ElementType!R, alias compare = less_than)(R range, T item)

[should work iff the sort implementation only calls the predicate]

artur


More information about the Digitalmars-d-learn mailing list