str/buf: Add append operator for fmtlib
New versions of fmtlib peer behind the back inserter iterator to do a
raw append operation to the buffer. We need to support the specific call
they expect.
Change-Id: Ia9bc4b08087f786fbcb0c9ee342457c3fcb07590
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/include/stdplus/str/buf.hpp b/include/stdplus/str/buf.hpp
index eed6314..7aba316 100644
--- a/include/stdplus/str/buf.hpp
+++ b/include/stdplus/str/buf.hpp
@@ -330,6 +330,11 @@
return as.store.dyn.ptr + oldlen;
}
+ constexpr void append(const CharT* begin, const CharT* end)
+ {
+ std::copy(begin, end, append(end - begin));
+ }
+
constexpr void push_back(CharT c) noexcept
{
*append(1) = c;