"toString(enum.value)" How?

Daniel919 Daniel919 at web.de
Mon Jul 9 16:40:52 PDT 2007


This would be nice:
Funny.tupleof should return a Tuple of values, like: "0 1 2 3"
Funny.names should return the names like: UNKNOWN, MAKES_ME_SMILE, ...

I guess with compile-time reflection we can also expect features like that.

Some time ago I was trying to do serialization, but getting the name of 
a member variable from a struct is not possible:
struct Foo { int x; int y; }; Foo foo;
writefln(foo.whatever[0]) should return "x";
Atm there is no builtin way to do this.


Daniel


More information about the Digitalmars-d-learn mailing list