complete initialization of the static allocated array

Alexandr Druzhinin drug2004 at bk.ru
Sun Aug 12 05:41:03 PDT 2012


12.08.2012 19:19, bearophile пишет:
>
> There are many ways, like (untested):
>
> AA.keys.sort().equals([EnumMembers!MyEnum].sort())
>
> Bye,
> bearophile

i've tested - it works fine:

import std.algorithm;	// for equal()
import std.traits;	// for EnumMembers(T)

...

enforce(equal(AA.keys.sort, [EnumMembers!MyEnum].sort), "Assert message");


I learn D and I'm interested in the ways specific to D like yours 
example above to get power of D. Thanks!


More information about the Digitalmars-d-learn mailing list