Skip to content

Commit

Permalink
Update bits.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-johansson committed Oct 28, 2023
1 parent 08113d7 commit b0b97f1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions modules/core/inc/tactile/core/platform/bits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <algorithm> // reverse
#include <bit> // bit_cast, endian, byteswap
#include <concepts> // integral, invocable
#include <cstddef> // byte
#include <cstring> // memcpy
#include <type_traits> // has_unique_object_representations_v
#include <type_traits> // is_trivially_copyable_v, is_trivially_constructible_v
Expand Down Expand Up @@ -62,7 +61,7 @@ template <std::integral IntType>
#if __cpp_lib_byteswap >= 202110L
return std::byteswap(value);
#else
using ByteArray = Array<std::byte, sizeof(IntType)>;
using ByteArray = Array<uint8, sizeof(IntType)>;

const auto bytes = interpret_as<ByteArray>(value);
std::reverse(bytes.begin(), bytes.end());
Expand Down

0 comments on commit b0b97f1

Please sign in to comment.