On Friday, 19 June 2015 at 14:04:05 UTC, Daniel Kozák wrote:

On Fri, 19 Jun 2015 13:52:52 +0000
Quentin Ladeveze via Digitalmars-d-learn
<digitalmars-d-learn@puremagic.com> wrote:

On Friday, 19 June 2015 at 13:38:45 UTC, Steven Schveighoffer wrote:
>
> Does this work for you, or is there a further expectation?
>
> auto asTuple() { return Tuple!(int, "a", ...)(a, b, > stringValue);}
>
> -Steve

In fact, I was trying to use traits to create the tuple
automatically and being able to add or remove methods to the
struct without breaking the asTuple method.
I used allMembers for the name of the methods, but I didn't found
anything for their return types or their values.

Thank you.
http://dlang.org/phobos/std_traits.html#ReturnType http://dlang.org/phobos/std_traits.html#ParameterTypeTuple

These are interesting and can be useful, but allMembers returns strings and not functions, so I can't apply ReturnType.


Reply via email to