mirror of
https://github.com/dlang/phobos.git
synced 2025-05-05 17:42:58 +03:00
Add more test case
This commit is contained in:
parent
a404b3108f
commit
0c88021d4b
1 changed files with 12 additions and 0 deletions
|
@ -2000,6 +2000,18 @@ unittest
|
||||||
assert(baz(S(), makeS(), n, s) == "LLRRRL");
|
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
|
// splitter
|
||||||
/**
|
/**
|
||||||
Splits a range using an element as a separator. This can be used with
|
Splits a range using an element as a separator. This can be used with
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue