diff --git a/BAN/include/BAN/Endianness.h b/BAN/include/BAN/Endianness.h index 0d4b7411..41ffe53f 100644 --- a/BAN/include/BAN/Endianness.h +++ b/BAN/include/BAN/Endianness.h @@ -58,6 +58,11 @@ namespace BAN template struct LittleEndian { + constexpr LittleEndian(T value) + { + raw = host_to_little_endian(value); + } + constexpr operator T() const { return host_to_little_endian(raw); @@ -69,6 +74,11 @@ namespace BAN template struct BigEndian { + constexpr BigEndian(T value) + { + raw = host_to_big_endian(value); + } + constexpr operator T() const { return host_to_big_endian(raw); @@ -77,4 +87,7 @@ namespace BAN T raw; }; + template + using NetworkEndian = BigEndian; + }