Hello,

I wanted to know if such code was possible :

alias Operation = Algebraic!(/* All type that implements X UDA */)

struct X
{
    int opcode;
    Operation h;
}

@X(0x01, Hello(3))
@X(0x02, Hello(4))
struct Hello
{
    int Hello;
}

@X(0x03, Toto(5))
@X(0x05, Toto(6))
struct Toto
{
   int A;
}


It has two problems, Operation not being defined while I use it in the UDA, and how to get back all the types that implements this UDA to give it to Algebraic. I don't know if it's a good idea or not, but might as well try the dark side of meta programming.

Thanks a lot :)

Reply via email to