enum-indexed arrays

"Nordlöw" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Sep 20 16:10:27 PDT 2014


On Saturday, 20 September 2014 at 22:13:30 UTC, Baz wrote:
> Not true, because you can use std.traits.EnumMembers to prepare 
> an enum member rank lookup table, so that values have even not 
> be consecutive.

You're correct. Even better not having that limitation :)

>
> there is an example here:
> http://dlang.org/phobos/std_traits.html#EnumMembers
>
> and a concret application in this personal project (e.g line 
> 111):
> https://github.com/BBasile/bitSet/blob/master/import/bitsets/bitsets.d

Nice!


More information about the Digitalmars-d-learn mailing list