UDA question

Timon Gehr timon.gehr at gmx.ch
Tue Apr 16 03:04:00 PDT 2013


On 04/16/2013 08:29 AM, Ulf Johansson wrote:
> ...
>
> The problem I have is quite simple - getting the value of 'atom' out of
> the message attribute. How can I do this? I did not post any of my
> actual code, I hope the above example describes the problem.
> ...


struct message{
     int atom;
}

class AnActor{
     @message(3) void myHandler(string arg1, real arg2){ }
     static assert(__traits(getAttributes, myHandler)[0].atom==3);
}

(Consider posting to d.D.learn for basic questions.)


More information about the Digitalmars-d mailing list