On 4/10/11, Jesse Phillips <[email protected]> wrote: > Andrej Mitrovic Wrote: > >> It's a shame that an enum with a tag doesn't have a .length property. >> I've had to use __traits to build an array just to get the length. > > It has .max > > http://www.digitalmars.com/d/2.0/enum.html >
That doesn't show me the number of values an enum tag has, only its
largest value.
void main()
{
writeln(foo.max); // 101, not 4
}
enum foo : int
{
a,
b,
c = 100,
d
}
