Return types of the methods of a struct

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jun 19 07:37:38 PDT 2015


On 6/19/15 10:01 AM, Baz wrote:
> On Friday, 19 June 2015 at 13:52:54 UTC, Quentin Ladeveze 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.
>
> when the return type is defined inside the function it's called a
> 'Voldemort type',
> see http://www.drdobbs.com/cpp/voldemort-types-in-d/232901591?pgno=2

Actually, this isn't a voldemort type, because the type can be named 
outside the function.

-Steve


More information about the Digitalmars-d-learn mailing list