[Issue 6617] Two problems using enum lenghs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 2 10:34:50 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=6617



--- Comment #4 from bearophile_hugs at eml.cc 2012-12-02 10:34:49 PST ---
(In reply to comment #2)

> We could instead provide a template in std.traits:
> 
> template EnumLength(E) if (is(E == enum))
> {
>     enum size_t EnumLength = EnumMembers!E.length;
> }
> 
> void main()
> {
>     assert(EnumLength!Foo == 1);
> }

I think this gives too much little improvement :-) Such EnumLength template is
not needed in Phobos.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list