4 ms·
I don't really buy the idea that invoking undefined behaviour is ok so long as you know it happens to work on your platform. If that disaster really does boil
by MaxBarraclough 8y ago
I don't really buy the idea that invoking undefined behaviour is ok so long as you know it happens to work on your platform.
If that disaster really does boil down to one instruction, I'd hope the compiler would expose an intrinsic.
Doing that kind of thing isn't so evil if you're careful to include a compile-time assert that will break the build (or perhaps 'failover' to safe code) if you try to compile on anything but your exact compiler and for anything but your exact target platform, but even so, I've never seen an appropriate time to deliberately invoke UB like that.