4 ms·
> In some of our code, we would test the size of various types and structures on startup This is one of the things that C++ has actually improved a lot recentl
by bzbarsky 7y ago
> In some of our code, we would test the size of various types and structures on startup
This is one of the things that C++ has actually improved a lot recently: doing this with static_assert is much nicer in terms of catching problems early... And yes, it's great for long-term maintainability.
- unwind 7y agoC has had standardized static assert since the C11 spec was released. See [1] for instance. [1]: https://stackoverflow.com/a/7287341 https://stackoverflow.com/a/7287341