Another serialization topic, reduced scope

Tobias Pankrath tobias+dlang at
Sun Dec 8 21:19:26 UTC 2019

On Saturday, 7 December 2019 at 18:53:51 UTC, Jesse Phillips 
> @optional

If we look at e.g. or they seem to 
have optional by default. So we should at least consider this as 
well, e.g.

1. have optional by default and introduce @required
2. make it configurable on the containing struct / class

enum IfMissing {

struct S
     // all fields by default optional due to @missing
     int x;
     int a = 4; // set to 0 if not provided during deserialization

3. something else ..

More information about the Digitalmars-d mailing list