#pragma once #include "binary-serializer.hpp" #include #include namespace floormat::Serialize { template It> struct binary_writer final { explicit constexpr binary_writer(It it) noexcept; template constexpr void write(T x) noexcept; constexpr void write_asciiz_string(StringView str) noexcept; constexpr std::size_t bytes_written() const noexcept { return _bytes_written; } private: It it; std::size_t _bytes_written; }; template It, serializable T> constexpr binary_writer& operator<<(binary_writer& writer, T x) noexcept; } // namespace floormat::Serialize