diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-09 16:40:27 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-09 16:40:27 +0200 |
commit | 150948c5cd962237436a81c61a81a9cbb453f2e4 (patch) | |
tree | a8378fdea28420a35e2b3ef658a8d5ba65ccf8b1 /serialize | |
parent | ad4b46dff41edb27b5e5d5c3fa6559182071a4a7 (diff) |
b
Diffstat (limited to 'serialize')
-rw-r--r-- | serialize/binary-reader.hpp | 8 | ||||
-rw-r--r-- | serialize/binary-serializer.hpp | 4 | ||||
-rw-r--r-- | serialize/binary-writer.hpp | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/serialize/binary-reader.hpp b/serialize/binary-reader.hpp index ebe7ffde..6dc65723 100644 --- a/serialize/binary-reader.hpp +++ b/serialize/binary-reader.hpp @@ -1,7 +1,7 @@ #pragma once #include "binary-serializer.hpp" #include <array> -#include <iterator> +//#include <iterator> #include <Corrade/Containers/StringView.h> namespace floormat::Serialize { @@ -26,7 +26,7 @@ template<string_input_iterator It> struct binary_reader final { template<char_sequence Seq> explicit constexpr binary_reader(const Seq& seq) noexcept; constexpr binary_reader(It begin, It end) noexcept; - constexpr void assert_end() noexcept(false); + constexpr CORRADE_ALWAYS_INLINE void assert_end() noexcept(false); constexpr size_t bytes_read() const noexcept { return num_bytes_read; } template<serializable T> constexpr T read() noexcept(false); @@ -47,10 +47,10 @@ private: }; template<string_input_iterator It, serializable T> -constexpr void operator<<(T& x, binary_reader<It>& reader) noexcept(false); +constexpr CORRADE_ALWAYS_INLINE void operator<<(T& x, binary_reader<It>& reader) noexcept(false); template<string_input_iterator It, serializable T> -constexpr void operator>>(binary_reader<It>& reader, T& x) noexcept(false); +constexpr CORRADE_ALWAYS_INLINE void operator>>(binary_reader<It>& reader, T& x) noexcept(false); template<string_input_iterator It> binary_reader(It&& begin, It&& end) -> binary_reader<std::decay_t<It>>; diff --git a/serialize/binary-serializer.hpp b/serialize/binary-serializer.hpp index f277aae9..c95bedef 100644 --- a/serialize/binary-serializer.hpp +++ b/serialize/binary-serializer.hpp @@ -31,13 +31,13 @@ concept serializable = requires(T x) { }; template<typename T> -constexpr inline T maybe_byteswap(T x) noexcept +constexpr CORRADE_ALWAYS_INLINE T maybe_byteswap(T x) noexcept { return x; } template<integer T> -constexpr inline T maybe_byteswap(T x) noexcept +constexpr CORRADE_ALWAYS_INLINE T maybe_byteswap(T x) noexcept { if constexpr(std::endian::native == std::endian::big) return std::byteswap(x); diff --git a/serialize/binary-writer.hpp b/serialize/binary-writer.hpp index 54e70a5c..cf1e9fd0 100644 --- a/serialize/binary-writer.hpp +++ b/serialize/binary-writer.hpp @@ -19,6 +19,6 @@ private: }; template<std::output_iterator<char> It, serializable T> -constexpr binary_writer<It>& operator<<(binary_writer<It>& writer, T x) noexcept; +constexpr CORRADE_ALWAYS_INLINE binary_writer<It>& operator<<(binary_writer<It>& writer, T x) noexcept; } // namespace floormat::Serialize |