August 03, 2014 Re: auto ref function parameters in a free function | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vlad Levenfeld | 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
|
August 04, 2014 Re: auto ref function parameters in a free function | ||||
---|---|---|---|---|
| ||||
Posted in reply to Artur Skawina | On Sunday, 3 August 2014 at 21:47:06 UTC, Artur Skawina via Digitalmars-d-learn wrote:
> 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
This works! Thanks!
|
Copyright © 1999-2021 by the D Language Foundation