Sfoglia il codice sorgente

Make endian_wrapper conversion operator const

master
Emil-Jarosz 3 anni fa
parent
commit
275e85d5e2
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. +2
    -2
      include/gp/math/boolean/bitops.hpp

+ 2
- 2
include/gp/math/boolean/bitops.hpp Vedi 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);
}
};

Caricamento…
Annulla
Salva