Add an experimental writer API

This commit is contained in:
Victor Zverovich
2024-08-17 09:54:09 -07:00
parent 020af729dd
commit 94b8bc8eae
4 changed files with 87 additions and 14 deletions
+5
View File
@@ -376,6 +376,11 @@ class FMT_API ostream : private detail::buffer<char> {
ostream(ostream&& other) noexcept;
~ostream();
operator writer() {
detail::buffer<char>& buf = *this;
return buf;
}
void flush() {
if (size() == 0) return;
file_.write(data(), size() * sizeof(data()[0]));