[Issue 4997] names, values, length and basetype enum properties

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 1 15:45:02 PDT 2012


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



--- Comment #2 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-05-01 15:46:12 PDT ---
What would really help is if you could have properties for types, something
akin to:

@property int length(T)()
    if (is(T == enum))
{
    return __traits(allMembers, T).length;
}

That won't work, but that's the basic idea. Then you could put these functions
into Phobos instead of complicating the language. Of course if the above work
it would also complicate the language, so I dunno..

-- 
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