From d1f9b06f844a452c45f2e6ecd2c6f05429a20ed1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 29 Jul 2021 17:15:40 +0200 Subject: [PATCH] io/BufferedOutputStream: add WriteT() --- src/fs/io/BufferedOutputStream.hxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fs/io/BufferedOutputStream.hxx b/src/fs/io/BufferedOutputStream.hxx index 3aa6df4d2..62ecb60ac 100644 --- a/src/fs/io/BufferedOutputStream.hxx +++ b/src/fs/io/BufferedOutputStream.hxx @@ -58,8 +58,13 @@ public: void Write(const void *data, std::size_t size); + template + void WriteT(const T &value) { + Write(&value, sizeof(value)); + } + void Write(const char &ch) { - Write(&ch, sizeof(ch)); + WriteT(ch); } void Write(const char *p);