std.serialization: pre-voting review / discussion

Tyler Jameson Little beatgammit at gmail.com
Wed Aug 14 02:25:04 PDT 2013


On Wednesday, 14 August 2013 at 09:17:44 UTC, Tove wrote:
> On Wednesday, 14 August 2013 at 08:48:23 UTC, Jacob Carlborg 
> wrote:
>> On 2013-08-14 10:19, Tyler Jameson Little wrote:
>>> - Typo: NonSerialized example should read NonSerialized!(b)
>>
>> No, it's not a typo. If you read the documentation you'll see 
>> that:
>>
>> "If no fields or "this" is specified, it indicates that the 
>> whole class/struct should not be (de)serialized."
>
> I understand the need for Orange to be backwards compatible, 
> but for std.serialization, why isn't the old-style mixin simply 
> removed in favor of the UDA.
>
> Furthermore for "template NonSerialized(Fields...)" there is an 
> example, while for the new style "struct nonSerialized;" there 
> isn't!
>
> I find the newstyle both more intuitive and you also more dry 
> not duplicating the identifier: "int b; mixin NonSerialized!(b)"
>
> @nonSerialized struct Foo
> {
>     int a;
>     int b;
>     int c;
> }
>
> struct Bar
> {
>     int a;
>     int b;
>     @nonSerialized int c;
> }

I like this a lot more. Phobos just needs to be compatible with 
the current release, so backwards compat is a non-issue here.


More information about the Digitalmars-d mailing list