3 ms·
This kind of optimized placement could in principle be done by a sufficiently smart compiler, but no such compiler exists. That's why existing compilers allow
by adonovan 11y ago
This kind of optimized placement could in principle be done by a sufficiently smart compiler, but no such compiler exists. That's why existing compilers allow their users to control layout by, as you say, relying on an implementation detail.
- masklinn 11y agoNo, the language can specify source—order struct layout, either by default or opt-in.