42 ms·
For cases when performance matters one can replace the members with a stab of the same size and alignment and cast the the stab to the real defition in the impl
by fpoling 8y ago
For cases when performance matters one can replace the members with a stab of the same size and alignment and cast the the stab to the real defition in the implementation.
- adrianN 8y agoUgh, that violates strict aliasing, does it not?
- fpoling 8y agoI suppose it can, but in practice it works with any sane compiler that reasonably deals with reinterpret_cast and aliasing as long as aliasing requirements for the stub and the real thing are the same. The latter can be enforced with static asserts.
- deleted 8y ago[deleted]