Proposal:
enhance TypeInfo so that for a struct like this:
struct S
{
byte[8] x;
int y;
alias y this;
}
.. the following code will be valid:
auto ti = typeid(S.init);
assert (ti.aliasthis.offset == 8);
assert (ti.aliasthis.next == typeid(int.init));
Use case:
RTTI based formatting/logging, most importantly in cases where `alias this` struct is used as a replacement for typedef.
Comment #1 by robert.schadek — 2024-12-07T13:36:24Z