Proposal: user defined attributes
F i L
witte2008 at gmail.com
Wed Mar 21 08:26:16 PDT 2012
On Wednesday, 21 March 2012 at 15:20:35 UTC, F i L wrote:
> Andrei Alexandrescu wrote:
>> In case there are several non-serialized variables, how do you
>> avoid clashes between different definitions of __nonSerialized?
>
> struct A {
> int a, b;
> mixin NonSerialized!(a, b);
> }
>
> static const __nonSerialized = ["a", "b"];
Also, if where meant how could you store multiple types, you
could just use an Associative Array:
struct A {
int a;
float b;
mixin NonSerialized!(a, b);
}
static const __nonSerialized = ["int":"a", "int":"b"];
More information about the Digitalmars-d
mailing list