3 ms·
Just tried this with godbolt.org and yes, the memcpy() thing is consistently good while the shift-and-or version often gets an unoptimized implementation (depen
by pjscott 8y ago
Just tried this with godbolt.org and yes, the memcpy() thing is consistently good while the shift-and-or version often gets an unoptimized implementation (depending on compiler and version).
- beached_whale 8y agoIn C++, not necessarily C, memcpy is how you type pun. Seeing as they often are the same compiler it's probably the fastest way.