← Back to index
|
Original Bugzilla link
Bug 16166 – struct constructor and AliasSeq
Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2016-06-12T02:56:16Z
Last change time
2024-12-13T18:48:28Z
Assigned to
No Owner
Creator
Danila Letunovskiy
Moved to GitHub: dmd#17761 →
Comments
Comment #0
by kapblc — 2016-06-12T02:56:16Z
struct Window { string title; int x, y; int w, h; //this(T...)(T t){ // foreach(i, n; t) this.tupleof[i] = n; //} } alias seq(T...) = T; void main(){ Window a = seq!("Foo", 100, 100, 640, 480); // or import std.typecons; Window b = tuple("Foo", 100, 100, 640, 480).expand; writeln(a); }
Comment #1
by kapblc — 2016-06-12T14:44:22Z
this(T...)(T t){ this.tupleof[0..t.length] = t; } I want that this work by default.
Comment #2
by kapblc — 2016-06-16T01:59:09Z
struct Window { string title; int x, y; int w, h; alias title this; } void main(){ Window w = "Foo"; }
Comment #3
by robert.schadek — 2024-12-13T18:48:28Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/dmd/issues/17761
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB