From 585ff0a1febb0deabcfe81dcb7a551e90dd208b6 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 16 Mar 2019 14:51:09 -0500 Subject: [PATCH] [ox/std] Add raw to byteswap type --- deps/ox/src/ox/std/byteswap.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/deps/ox/src/ox/std/byteswap.hpp b/deps/ox/src/ox/std/byteswap.hpp index e048d8ad..d4dd9612 100644 --- a/deps/ox/src/ox/std/byteswap.hpp +++ b/deps/ox/src/ox/std/byteswap.hpp @@ -174,6 +174,15 @@ class __attribute__((packed)) ByteSwapInteger { return newVal; } + /** + * Returns the integer as it is stored. If it is stored as little endian, + * a little endian integer is returned regardless of the endianness of + * the system. + */ + constexpr auto raw() noexcept -> T { + return m_value; + } + }; template