Accessing UDA of private field

Tove tove at fransson.se
Mon Jan 7 03:59:40 PST 2013


On Monday, 7 January 2013 at 10:19:45 UTC, Jacob Carlborg wrote:
> On 2013-01-06 23:33, Philippe Sigaud wrote:
>>
>>    Good thinking. It's not pretty but it works. Thanks.
>>
>>
>> Maybe it can be hidden inside a template?
>
> Yeah, I'll see what I can do.

in which context does private fail? I'm using something like this:

struct my_struct
{
private:
   @(1) int t1;
   @(2) int t2;
   @(3) int t3;
}

foreach(m; __traits(allMembers, my_struct))
   with(my_struct.init)
     pragma(msg, __traits(getAttributes, mixin(m)));


More information about the Digitalmars-d mailing list