On Wednesday, July 27, 2016 13:09:07 Liam McSherry via Digitalmars-d wrote: > Since it isn't mentioned in the documentation, do > `std.traits.Fields(T)` and `std.traits.FieldNameTuple(T)` return > the fields and field names in a deterministic order? > > Further, will they return the fields/field names in the same > order? That is, will `fields[0]` be the type of `field_names[0]`?
It's not guaranteed, but given their implementations and what they do, it will almost certainly always be true. But given that it's not guaranteed, I'm not sure that it would be a great idea to rely on it. However, there's really no point in relying on it. Just use Fields and use stringof on a field when you want its name. That's all that FieldNameTuple is really doing internally anyway. - Jonathan M Davis
