Re: List all enum in a class

2013-06-16 Thread Adam D. Ruppe
On Friday, 14 June 2013 at 12:06:11 UTC, Bruno Deligny wrote: I doesn't work with 2.063 Hmm, I don't know what's going on. Can someone else try to make it work?

Re: List all enum in a class

2013-06-14 Thread Bruno Deligny
On Friday, 14 June 2013 at 11:44:45 UTC, Bruno Deligny wrote: On Thursday, 13 June 2013 at 17:13:26 UTC, Adam D. Ruppe wrote: On Thursday, 13 June 2013 at 17:05:43 UTC, Bruno Deligny wrote: i tried your test and it doesn't print test. Maybe we have different versions of the compiler (I think

Re: List all enum in a class

2013-06-14 Thread Bruno Deligny
On Thursday, 13 June 2013 at 17:13:26 UTC, Adam D. Ruppe wrote: On Thursday, 13 June 2013 at 17:05:43 UTC, Bruno Deligny wrote: i tried your test and it doesn't print test. Maybe we have different versions of the compiler (I think this behavior recently changed). Try running dmd without arg

Re: List all enum in a class

2013-06-13 Thread Adam D. Ruppe
On Thursday, 13 June 2013 at 12:46:49 UTC, bearophile wrote: Is it worth asking a D enhancement? I don't think so because it isn't something you'd even really need to know, it is just like writing a literal. Actually that gives me an idea: if you have a variable that is not a function and o

Re: List all enum in a class

2013-06-13 Thread Adam D. Ruppe
On Thursday, 13 June 2013 at 17:05:43 UTC, Bruno Deligny wrote: i tried your test and it doesn't print test. Maybe we have different versions of the compiler (I think this behavior recently changed). Try running dmd without arguments and see what the first line says. Mine is: DMD32 D Comp

Re: List all enum in a class

2013-06-13 Thread Jonathan M Davis
On Thursday, June 13, 2013 14:46:48 bearophile wrote: > Adam D. Ruppe: > > However as far as I know right now, there's no way to get "b" > > as an enum here because the typeof will always just return > > string. > > Is it worth asking a D enhancement? It's a manifest constant, so it's not really

Re: List all enum in a class

2013-06-13 Thread Bruno Deligny
i tried your test and it doesn't print test.

Re: List all enum in a class

2013-06-13 Thread bearophile
Adam D. Ruppe: However as far as I know right now, there's no way to get "b" as an enum here because the typeof will always just return string. Is it worth asking a D enhancement? Bye, bearophile

Re: List all enum in a class

2013-06-13 Thread Adam D. Ruppe
Try this: class type { enum b = "hey"; enum test { lol, rofl } test mem; } template workaround(T) { alias workaround = T; } import std.stdio; void main() { foreach (member; __traits(allMembers, type)) { stat