Comment #0 by verylonglogin.reg — 2013-03-24T23:26:46Z
Type tuples and its slices contain also other information which is neither obvious nor documented:
---
void f(int) { }
void g(ref int) { }
static if(is(typeof(f) Pf == function) && is(typeof(g) Pg == function))
{
// Indexing returns types, everything is clear:
static assert(is(Pf[0] == Pg[0]));
static assert(is(void function(Pf[0]) == void function(Pg[0])));
// This only means corresponding types are equal, not tuples:
static assert(is(Pf == Pg));
// Tuples and its slices are different:
// (Pg contains information that its first type is `ref`)
static assert(!is(void function(Pf) == void function(Pg)));
static assert(!is(void function(Pf[0 .. 1]) == void function(Pg[0 .. 1])));
}
else
static assert(0);
---
Comment #1 by robert.schadek — 2024-12-15T15:22:06Z