On Sunday, 3 August 2014 at 19:30:38 UTC, Vlad Levenfeld wrote:
On Sunday, 3 August 2014 at 19:26:28 UTC, anonymous wrote:
Works for me with dmd versions back to 2.060. What compiler are
you using?
dmd 2.065
Here's how I'm testing this:
$ dmd | head -n 1
DMD64 D Compiler v2.065
$ cat less_than.d
bool less_than (T)(auto ref T a, auto ref T b)
{
return a < b;
}
void main()
{
int a = 1, b = 2;
assert(less_than(a, b));
assert(less_than(a, 2));
assert(less_than(1, b));
assert(less_than(1, 2));
}
$ dmd less_than.d && echo ok
ok
If this exact code errors for you, it ... uhh ... could be
platform specific? Are you on Windows?