Phobos' std.conv.to-conversion from enum to string doesn't scale beyond hundreds of enumerators

Per Nordlöw per.nordlow at gmail.com
Mon Jun 25 07:52:58 UTC 2018


On Monday, 25 June 2018 at 07:43:53 UTC, Per Nordlöw wrote:
> On Monday, 25 June 2018 at 00:35:40 UTC, Jonathan M Davis wrote:
>> Or if you want it to stay an AliasSeq, then just use Alias or 
>> AliasSeq on it. e.g.
>>
>> alias members = AliasSeq!(__traits(allMembers, E));
>
> Thanks! Should we prefer this over
>
>     enum members = [__traits(allMembers, E)];
>
> ?

I tested on a really big enum:

     alias members = AliasSeq!(__traits(allMembers, E));

is faster. :)


More information about the Digitalmars-d mailing list