On 01/25/14 16:38, Johannes Pfau wrote:
> Is it possible to generate a enum from a tuple of types without string
> mixins?
> ------------
> struct S(Types...)
> {
> enum Tag
> {
> //?
> }
> }
> ------------
>
> where the tag enum should have Types.length members. The exact names of
> the enum members don't matter and could be numbered, for example:
> Tag._1, Tag._2, ...
Well, if you don't need names then just use the index directly.
Eg, see 'DiscUnion.type' in
http://forum.dlang.org/thread/[email protected]#post-mailman.555.1377703234.1719.digitalmars-d-learn:40puremagic.com
(A newer compiler may allow for that offset-of calculation at CT)
artur