I want to create my own Tuple type

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Jan 11 14:32:32 UTC 2021


On Monday, 11 January 2021 at 14:03:39 UTC, Paul Backus wrote:
> On Monday, 11 January 2021 at 09:42:39 UTC, Ola Fosheim Grøstad 
> wrote:
>> On Monday, 11 January 2021 at 05:59:03 UTC, Paul Backus wrote:
>>> You can just fall back to `alias expand this` like Phobos's 
>>> Tuple does in this case. No compiler modification needed.
>>
>> I though maybe it would be nice in general to be able to 
>> create static indexed type by having a special field name 
>> pattern, but I will have a another look at staticMap (I don't 
>> really want the full staticMap into object.d though).
>
> I have no idea why you're bringing up staticMap here. The 
> simplest way to create a tuple's fields is to use type sequence 
> instantiation [1], like Phobos does:

Ok, thanks. I guess typecons only use staticMap because it allows 
for named fields.



More information about the Digitalmars-d-learn mailing list