summaryrefslogtreecommitdiffhomepage
path: root/serialize/binary-writer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'serialize/binary-writer.hpp')
-rw-r--r--serialize/binary-writer.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/serialize/binary-writer.hpp b/serialize/binary-writer.hpp
index 625bb53c..54e70a5c 100644
--- a/serialize/binary-writer.hpp
+++ b/serialize/binary-writer.hpp
@@ -7,14 +7,15 @@ namespace floormat::Serialize {
template<std::output_iterator<char> It>
struct binary_writer final {
- explicit constexpr binary_writer(It it) noexcept;
+ explicit constexpr binary_writer(It it, size_t allocated_bytes) noexcept;
template<serializable T> constexpr void write(T x) noexcept;
constexpr void write_asciiz_string(StringView str) noexcept;
constexpr size_t bytes_written() const noexcept { return _bytes_written; }
+ constexpr size_t bytes_allocated() const noexcept { return _bytes_allocated; }
private:
It it;
- size_t _bytes_written;
+ size_t _bytes_written, _bytes_allocated;
};
template<std::output_iterator<char> It, serializable T>