\brief Copy the value's bytes in big-endian byte order
| 116 | |
| 117 | /// \brief Copy the value's bytes in big-endian byte order |
| 118 | void ToBigEndian(uint8_t* dest) const { |
| 119 | const auto bytes = ToBigEndian(); |
| 120 | std::memcpy(dest, bytes.data(), bytes.size()); |
| 121 | } |
| 122 | /// \brief Return the value's bytes in big-endian byte order |
| 123 | constexpr std::array<uint8_t, 2> ToBigEndian() const { |
| 124 | return {uint8_t(bits_ >> 8), uint8_t(bits_ & 0xff)}; |