Skip to content

Commit

Permalink
Add more test case
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Nov 25, 2012
1 parent a404b31 commit 0c88021
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions std/algorithm.d
Expand Up @@ -2000,6 +2000,18 @@ unittest
assert(baz(S(), makeS(), n, s) == "LLRRRL");
}

unittest
{
ref int foo(ref int a) { return a; }
ref int bar(Args)(auto ref Args args)
{
return foo(forward!args);
}
static assert(!__traits(compiles, { auto x1 = bar(3); })); // case of NG
int value = 3;
auto x2 = bar(value); // case of OK
}

// splitter
/**
Splits a range using an element as a separator. This can be used with
Expand Down

0 comments on commit 0c88021

Please sign in to comment.