Usability of "allMembers and derivedMembers traits now only return visible symbols"
Andrej Mitrovic via Digitalmars-d
digitalmars-d at puremagic.com
Sat Sep 3 09:39:53 PDT 2016
On 9/3/16, Martin Nowak via Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> On Wednesday, 31 August 2016 at 13:12:30 UTC, Adam D. Ruppe wrote:
>> Ugh, it really should just give everything and have getMember
>> bypass it. That won't even break any code!
> It will, e.g. having getMember bypass protection means vibe.d
> would now serialize private members
Then just add a check in vibe.d itself to avoid serializing private
members. You can still call getProtection on the symbol and skip
Alternatively you can use UDAs so you can mark which fields should or
shouldn't be serializible. For example
The bottom line is with restricting access to private symbols you have
no choice on the matter, while allowing access lets you specialize
whether to ignore the symbols or not.
More information about the Digitalmars-d