struct S { int a, b; } auto s = cast(S)10; //compiles and sets s.a to 10.
It works also for any other type, if the structure contains a member of that type in the first position.
Is this normal behaviour?
rumbu via Digitalmars-d-learn Wed, 15 Jul 2015 08:51:16 -0700
struct S { int a, b; } auto s = cast(S)10; //compiles and sets s.a to 10.
It works also for any other type, if the structure contains a member of that type in the first position.
Is this normal behaviour?