float init 0 request

Walter Bright newshound2 at digitalmars.com
Fri Aug 14 17:57:27 UTC 2026


On 8/14/2026 9:23 AM, Kapendev wrote:
> Only issue remaining are structs and generic code.
> Those two I get that it might be annoying to set default values only for floats.

You can set a default value for struct fields like this:
```d
struct S { int a = 7; }

S s;
assert(s.a == 7);
```
Perfectamundo!



More information about the Digitalmars-d mailing list