Efficient enum array keys?

Basile B. b2.temp at gmx.com
Thu Apr 11 08:15:24 UTC 2019


On Thursday, 11 April 2019 at 07:56:42 UTC, Julian wrote:
> On Thursday, 11 April 2019 at 06:45:23 UTC, Basile B. wrote:
>> On Thursday, 11 April 2019 at 06:20:05 UTC, Julian wrote:
> I don't see a difference in micro-benchmarks. *shrug*

Your enum is int so in machine code it's exactly like processing 
a machine word.
It's not even worth benchmarking this ;)

As a side note, and in case you would not know it yet, there's 
this traits that's useful with enums: 
https://dlang.org/phobos/std_traits.html#EnumMembers


More information about the Digitalmars-d-learn mailing list