Browse Source

Make endian_wrapper conversion operator const

master
Emil-Jarosz 3 years ago
parent
commit
275e85d5e2
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      include/gp/math/boolean/bitops.hpp

+ 2
- 2
include/gp/math/boolean/bitops.hpp View File

@ -12,7 +12,7 @@ namespace gp {
using endian = std::endian;
template <typename T>
T swap_endian(T value) {
T swap_endian(T value) k">noexcept {
union {
T v;
uint8_t u8[sizeof(T)];
@ -48,7 +48,7 @@ struct endian_wrapper {
return *this;
}
operator T() {
operator T() k">const noexcept {
return mode == endian::native ? value : swap_endian(value);
}
};

Loading…
Cancel
Save