%s not producing string representation of enum?

Shriramana Sharma via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 10 20:58:30 PST 2015


Basile B.  wrote:

> You should rather use std.traits.EnumMembers to iterate the
> members of an enum:

Wow this is great! I was thinking that enum.max + 1 is not really befitting 
D's elegant approach to programming. Ali should really update that section 
of his book to use EnumMembers. This will both help avoid the above hack and 
only then will his reference to %s and %d having different effects for enums 
be true...

Thanks once more to Ali for his book and you people for the replies!

-- 
Shriramana Sharma, Penguin #395953


More information about the Digitalmars-d-learn mailing list