From dbaafe5ecea1b2350d526c51059b9f0d123b5669 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 28 Oct 2022 12:25:44 +0200 Subject: serializer work --- serialize/binary-serializer.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'serialize/binary-serializer.cpp') 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() >> std::de using test4 = binary_writer::iterator>; static_assert(std::is_same_v() << int() )>); +[[maybe_unused]] +static constexpr bool test5() +{ + std::array 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 -- cgit v1.2.3