diff --git a/BAN/include/BAN/Endianness.h b/BAN/include/BAN/Endianness.h index 796891af..e1ccc09d 100644 --- a/BAN/include/BAN/Endianness.h +++ b/BAN/include/BAN/Endianness.h @@ -70,15 +70,19 @@ namespace BAN template struct LittleEndian { + constexpr LittleEndian() + : raw(0) + { } + constexpr LittleEndian(T value) - { - raw = host_to_little_endian(value); - } + : raw(host_to_little_endian(value)) + { } constexpr operator T() const { return host_to_little_endian(raw); } + private: T raw; }; @@ -86,15 +90,19 @@ namespace BAN template struct BigEndian { + constexpr BigEndian() + : raw(0) + { } + constexpr BigEndian(T value) - { - raw = host_to_big_endian(value); - } + : raw(host_to_big_endian(value)) + { } constexpr operator T() const { return host_to_big_endian(raw); } + private: T raw; };