3 ms·
If your code depends on endianness you're either over-optimizing or doing something wrong. At least that's what I've learned over may years of reading the lesso
by phkahler 6y ago
If your code depends on endianness you're either over-optimizing or doing something wrong. At least that's what I've learned over may years of reading the lessons of many people.
- dodobirdlord 6y agoIf you're going to deploy your protocol buffer parsing library to literally a million servers you may be prepared to optimize the last shred of performance out of it. The authors have an unusual use case.
- zozbot234 6y agoIf you're "over-optimizing" in a way that makes your code depend on platform endianness, you're definitely doing things wrong. Even then, it's quite possible to make compilation error out if targeting the wrong endianness. This isn't something that the C++ standard should be concerned with.
- AnimalMuppet 6y agoReplying very late, because I was on vacation. In embedded, you're often talking directly to hardware chips. How you talk to those hardware chips absolutely depends on the endian-ness of the CPU... unless the chips all have 8-bit-only interfaces.