diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-28 12:25:44 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-28 12:25:44 +0200 |
| commit | dbaafe5ecea1b2350d526c51059b9f0d123b5669 (patch) | |
| tree | 9c0a07fc4558f88168eec4c121eae82a1e428106 /serialize/binary-serializer.cpp | |
| parent | b93ec1eee7d3199ecd1fa8bf2061622ede93a98c (diff) | |
serializer work
Diffstat (limited to 'serialize/binary-serializer.cpp')
| -rw-r--r-- | serialize/binary-serializer.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/serialize/binary-serializer.cpp b/serialize/binary-serializer.cpp index 2444b403..05959707 100644 --- a/serialize/binary-serializer.cpp +++ b/serialize/binary-serializer.cpp @@ -80,4 +80,17 @@ static_assert(std::is_same_v<test3&, decltype( std::declval<test3&>() >> std::de using test4 = binary_writer<std::array<char, sizeof(int)>::iterator>; static_assert(std::is_same_v<test4&, decltype( std::declval<test4&>() << int() )>); +[[maybe_unused]] +static constexpr bool test5() +{ + std::array<char, 4> bytes = {}; + auto w = binary_writer(bytes.begin()); + w << (char)0; + w << (char)1; + w << (char)2; + w << (char)3; + return bytes[0] == 0 && bytes[1] == 1 && bytes[2] == 2 && bytes[3] == 3; +} +static_assert(test5()); + } // namespace floormat::Serialize |
