Return types of the methods of a struct

Justin Whear via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jun 19 08:36:54 PDT 2015


On Fri, 19 Jun 2015 13:27:13 +0000, Quentin Ladeveze wrote:
> 
> Is there any way to have a asTuple method in this struct that would
> returns something like :
> 
> Tuple!(int, "a", float, "b", string, "c")
> 
> and that will contain the values of the methods of the struct ?
> 
> Thanks.

You'll want to work your way through this example carefully as it's 
basically template-based functional programming, but I think does what 
you want:
 http://dpaste.dzfl.pl/b048ea3adb93


More information about the Digitalmars-d-learn mailing list