Bug 24886 – std.typecons.Tuple does not support compatible `.tupleof` args

Status
NEW
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-11-27T04:40:10Z
Last change time
2024-12-01T16:43:18Z
Assigned to
No Owner
Creator
basile-z
Moved to GitHub: phobos#10569 →

Comments

Comment #0 by b2.temp — 2024-11-27T04:40:10Z
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.
Comment #1 by robert.schadek — 2024-12-01T16:43:18Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10569 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB