[Issue 21187] New: `.tupleof` should be directly usable as alias
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Aug 22 01:42:34 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=21187
Issue ID: 21187
Summary: `.tupleof` should be directly usable as alias
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: b2.temp at gmx.com
.tupleof solving generates a tuple for each use, so aliasing, without using an
AliasSeq, should work
---
struct F
{
alias thisTup = typeof(this).tupleof;
int a,b,c,d;
void test()
{
static foreach (i; 0 .. 4)
thisTup[i] = i + 1;
assert(a == 1);
assert(b == 2);
assert(c == 3);
assert(d == 4);
}
}
void main()
{
F().test();
}
---
--
More information about the Digitalmars-d-bugs
mailing list