auto ref function parameters in a free function

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Aug 3 12:26:27 PDT 2014


On Sunday, 3 August 2014 at 19:07:32 UTC, Vlad Levenfeld wrote:
> bool less_than (T)(auto ref T a, auto ref T b)
> {
> 	return a < b;
> }
>
> Error: auto can only be used for template function parameters

Works for me with dmd versions back to 2.060. What compiler are
you using?


More information about the Digitalmars-d-learn mailing list