[Issue 19036] .tupleof order guarantee

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 4 10:38:20 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19036

--- Comment #4 from Jacob Carlborg <doob at me.com> ---
(In reply to Guillaume Lathoud from comment #3)
> In another use case there is a class hierarchy, I
> also need the fields of the base class, which .tupleof does not provide, so
> I am not sure anymore how useful the present issue would be.

To get the fields of the base class you can upcast it and then use .tupleof.
That is: (cast(Base) subclassObject).tupleof. You can also use some traits in
Phobos to get the base class from a subclass.

--


More information about the Digitalmars-d-bugs mailing list