February 11, 2020 Re: Member function increases size of a struct defined in a function - is this a bug? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dennis | On Tuesday, 11 February 2020 at 13:04:01 UTC, Dennis wrote:
>
> But the takeaway is: even if you make a decision a bit more intelligently, it can increase compiler complexity in unexpected ways.
Yes, I am aware of the problem:
struct S {
int a;
// has the same problem as sizeof but compiles
static if (__traits(allMembers, S).length == 1) {
int b;
}
}
Don't know what would I do about it.
|
Copyright © 1999-2021 by the D Language Foundation