are std.traits.FieldNameTuple and std.traits.Fields returned value always in sync?

2020-06-20 Thread mw via Digitalmars-d-learn
Are their returned value, i.e the field names and their types are always in the same order, and of the same length? If they are not, how to get sync-ed pairs (name, type)? If they are, why we need two separate calls, which cause confusion.

Re: are std.traits.FieldNameTuple and std.traits.Fields returned value always in sync?

2020-06-20 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 20 June 2020 at 20:17:54 UTC, mw wrote: Are their returned value, i.e the field names and their types are always in the same order, and of the same length? If they are not, how to get sync-ed pairs (name, type)? If they are, why we need two separate calls, which cause confusion.

Re: are std.traits.FieldNameTuple and std.traits.Fields returned value always in sync?

2020-06-22 Thread mw via Digitalmars-d-learn
On Saturday, 20 June 2020 at 20:42:03 UTC, Stanislav Blinov wrote: On Saturday, 20 June 2020 at 20:17:54 UTC, mw wrote: Are their returned value, i.e the field names and their types are always in the same order, and of the same length? If they are not, how to get sync-ed pairs (name, type)? I

Re: are std.traits.FieldNameTuple and std.traits.Fields returned value always in sync?

2020-06-22 Thread Stanislav Blinov via Digitalmars-d-learn
On Monday, 22 June 2020 at 19:55:29 UTC, mw wrote: Yes, in the same order and of the same length. Can we add this information to the doc? to make it clear to the user: https://dlang.org/library/std/traits.html It's pretty clear in that doc already: alias FieldNameTuple(T) = staticMap!(N

Re: are std.traits.FieldNameTuple and std.traits.Fields returned value always in sync?

2020-06-23 Thread mw via Digitalmars-d-learn
On Monday, 22 June 2020 at 20:08:37 UTC, Stanislav Blinov wrote: But if you'd like it spelled out in text as well, you can make a PR for the Phobos repository. Just-Did-It: https://github.com/dlang/phobos/pull/7540 The point of doc is that the user don't have to dive into the code to know i