Beta 2.108.0
Sönke Ludwig
sludwig at outerproduct.org
Wed Mar 20 14:45:46 UTC 2024
Am 16.03.2024 um 11:31 schrieb Daniel N:
> ```d
> union U
> {
> float asFloat;
> uint asInt;
> }
>
> auto u0 = U(1.0); // this sets the `asFloat` field
> auto u1 = U(asInt: 0x3F800000); // formerly not possible
> ```
>
> Wow, this is so cool, can't wait to try it out, thanks to everyone who
> made it happen!
>
Note that this has already been possible in places where the {} syntax
can be used:
auto u1 = {asInt: 0x3F800000};
Still great to see this officially implemented!
More information about the Digitalmars-d-announce
mailing list