November 27 [Issue 24886] New: std.typecons.Tuple does not support compatible `.tupleof` args | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24886 Issue ID: 24886 Summary: std.typecons.Tuple does not support compatible `.tupleof` args Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: minor Priority: P1 Component: phobos Assignee: nobody@puremagic.com Reporter: b2.temp@gmx.com In the following code, calls to f2 are all rejected. That is a bit weird. ``` import std; struct S { uint a; uint b; } void f1(uint a, uint b){} void f2(Tuple!(uint, uint) a){} void main() { S s; uint[2] a; f1(s.tupleof); // OK f1(a.tupleof); // OK f2(s.tupleof); // NG f2(a.tupleof); // NG } ``` The reason for that is obviously that D does not do implict construction. In case D got first class citizen tuples this would have to work. -- |
Copyright © 1999-2021 by the D Language Foundation