3 ms·
Is initializing a NonZero field to 0 really initializing it?
by Lvl999Noob 5y ago
Is initializing a NonZero field to 0 really initializing it?
- staticassertion 5y agoSort of. It's definitely better than not initializing it.
- dathinab 5y agono not at all IMHO requiring all types in C to have a valid "all zero" variant so that this pattern can be used isn't grate either, somewhat of an anti-pattern even. But an anti-pattern needed for ergonomic C. The post is a good example for trying to program "like in a different language" just because some tools somewhat allow it. Like in this case "programming rust like it's C". And if you do rust FFI and have a lot of C experience it is tempting.