__traits(getMember)

Márcio Martins via Digitalmars-d digitalmars-d at puremagic.com
Thu Nov 3 05:32:47 PDT 2016


On Wednesday, 2 November 2016 at 19:49:24 UTC, Jacob Carlborg 
wrote:
> On 2016-11-02 17:30, Márcio Martins wrote:
>> Can we get a getMember and a getOverloads that won't check for
>> visibility or anything else?
>>
>> __traits appears really powerful, but every-time I try to use 
>> it for
>> anything other than a toy example or very simple 
>> serialization, it seems
>> like everything falls apart due to some detail... and I end up 
>> having to
>> hack it up with string mixins and static if(is(typeof(() { 
>> some_code; }))).
>
> For serialization, where you most likely only need to access 
> the fields, you can use .tupleof which will bypass the 
> protection.

@Jonathan I am on 2.072.0, but good to know it's coming.
@Jacob Thanks, that's good to know!


More information about the Digitalmars-d mailing list