digitalmars.D.bugs - [Issue 9810] New: Fact that type tuples contain not only tupes isn't documentated
- d-bugmail puremagic.com (38/38) Mar 24 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9810
http://d.puremagic.com/issues/show_bug.cgi?id=9810 Summary: Fact that type tuples contain not only tupes isn't documentated Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: spec Severity: normal Priority: P2 Component: websites AssignedTo: nobody puremagic.com ReportedBy: verylonglogin.reg gmail.com 09:26:46 MSK --- 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); --- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 24 2013