Suggestion: class/struct tuples preserve anonymous unions/structs
Frits van Bommel
fvbommel at REMwOVExCAPSs.nl
Thu Feb 15 10:25:52 PST 2007
Walter Bright wrote:
> Jarrett Billingsley wrote:
>> I'm not sure how anonymous unions and structs are handled by the
>> compiler.
>
> This has nothing to do with tuples. Anonymous structs and unions are
> used for layout only, the members are 'promoted' into the enclosing
> aggregate.
It's fairly obvious this is what's happening. And normally this wouldn't
matter as you wouldn't be able see the difference, but because of
.tupleof this is now detectable.
I think the real question here is: while this may be what *is*
happening, is this also what *should* happen? (i.e. "Is this a bug?")
I can't find anything specifying this behavior in the spec...
More information about the Digitalmars-d
mailing list