4 ms·
Sounds like a pretty easy class you could write in C++. Template it for anything that's integral if you want to get fancy so you can do BigEndian<int32_t> or Bi
by kllrnohj 4y ago
Sounds like a pretty easy class you could write in C++. Template it for anything that's integral if you want to get fancy so you can do BigEndian<int32_t> or BigEndian<int64_t> and provide operators that convert to/from the "native" type transparently.
Is that generically useful enough to be part of the C++ standard? Seems like the type of thing that more belongs in a helper utility (aka, surely something like Boost already has this)
- Findecanor 4y agoOf course that has crossed my mind, but I am not sure that there aren't opportunities for optimisation left if the compiler would retain higher-level information.
- gpderetta 4y agohttps://www.boost.org/doc/libs/1_78_0/libs/endian/doc/html/endian.html https://www.boost.org/doc/libs/1_78_0/libs/endian/doc/html/e...