tupleof function parameters?
aliak
something at something.com
Tue Aug 28 07:40:05 UTC 2018
On Tuesday, 28 August 2018 at 06:20:37 UTC, Sebastiaan Koppe
wrote:
> On Tuesday, 28 August 2018 at 06:11:35 UTC, Jon Degenhardt
> wrote:
>> The goal is to write the argument list once and use it to
>> create both the function and the Tuple alias. That way I could
>> create a large number of these function / arglist tuple pairs
>> with less brittleness.
>>
>> --Jon
>
> I would probably use a combination of std.traits.Parameters and
> std.traits.ParameterIdentifierTuple.
>
> Parameters returns a tuple of types and
> ParameterIdentifierTuple returns a tuple of strings. Maybe
> you'll need to implement a staticZip to interleave both tuples
> to get the result you want. (although I remember seeing one
> somewhere).
There's one in here -> https://code.dlang.org/packages/bolts
And the docs have a link to the particular forum post you're
thinking of as well for details.
More information about the Digitalmars-d-learn
mailing list