"name" of enum members

Jesse Phillips jessekphillips+D at gmail.com
Fri Feb 11 12:02:50 PST 2011


spir Wrote:

> On 02/11/2011 06:49 PM, Jesse Phillips wrote:
> > spir Wrote:
> >
> >> Hello,
> >>
> >> To denote a member 'm' of an enum 'e', one needs to write "e.m". Is there a way
> >> to get back this "name"?
> >> Here are my best trials:
> >
> > Maybe to!string(Enum.i) should return the enum name with it's field. This makes since because it is trying to return its name, and for named enums, where it comes from is important.
> 
> That's what I wrote, precisely (see example in OP), and it returns only "i".

It look like you were asking how you could do it, not that to!string should do it for you. My thought is added it to bugzilla.


More information about the Digitalmars-d-learn mailing list