mirror of
https://github.com/dlang/phobos.git
synced 2025-05-04 17:11:26 +03:00
Merge remote-tracking branch 'upstream/stable' into merge_stable
This commit is contained in:
commit
e45f39c55a
1 changed files with 19 additions and 2 deletions
|
@ -394,9 +394,8 @@ template Tuple(Specs...)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum areCompatibleTuples(Tup1, Tup2, string op) = isTuple!Tup2 && is(typeof(
|
enum areCompatibleTuples(Tup1, Tup2, string op) = isTuple!Tup2 && is(typeof(
|
||||||
|
(ref Tup1 tup1, ref Tup2 tup2)
|
||||||
{
|
{
|
||||||
Tup1 tup1 = void;
|
|
||||||
Tup2 tup2 = void;
|
|
||||||
static assert(tup1.field.length == tup2.field.length);
|
static assert(tup1.field.length == tup2.field.length);
|
||||||
foreach (i, _; Tup1.Types)
|
foreach (i, _; Tup1.Types)
|
||||||
{
|
{
|
||||||
|
@ -1148,6 +1147,24 @@ unittest
|
||||||
static assert( is(typeof(tc4 < tm4)));
|
static assert( is(typeof(tc4 < tm4)));
|
||||||
static assert( is(typeof(tc4 < tc4)));
|
static assert( is(typeof(tc4 < tc4)));
|
||||||
}
|
}
|
||||||
|
// Bugzilla 14890
|
||||||
|
static void test14890(inout int[] dummy)
|
||||||
|
{
|
||||||
|
alias V = Tuple!(int, int);
|
||||||
|
|
||||||
|
V mv;
|
||||||
|
const V cv;
|
||||||
|
immutable V iv;
|
||||||
|
inout V wv; // OK <- NG
|
||||||
|
inout const V wcv; // OK <- NG
|
||||||
|
|
||||||
|
foreach (v1; TypeTuple!(mv, cv, iv, wv, wcv))
|
||||||
|
foreach (v2; TypeTuple!(mv, cv, iv, wv, wcv))
|
||||||
|
{
|
||||||
|
static assert(__traits(compiles, v1 < v2),
|
||||||
|
typeof(v1).stringof ~ " < " ~ typeof(v2).stringof);
|
||||||
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
int[2] ints = [ 1, 2 ];
|
int[2] ints = [ 1, 2 ];
|
||||||
Tuple!(int, int) t = ints;
|
Tuple!(int, int) t = ints;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue