From f15a89328fa5defa4cc38cca77dd4fc033ead602 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Mon, 10 Jul 2023 19:08:23 -0400 Subject: [PATCH] add string writing support to string buffer --- include/blt/std/string.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/blt/std/string.h b/include/blt/std/string.h index 4051c56..0382b7d 100755 --- a/include/blt/std/string.h +++ b/include/blt/std/string.h @@ -34,12 +34,15 @@ namespace blt::string { } StringBuffer& operator<<(char c); + StringBuffer& operator<<(const std::string& str) { + for (char c : str) + *this << str; + return *this; + } template inline StringBuffer& operator<<(T t) { - auto str = std::to_string(t); - for (char c : str) - *this << c; + *this << std::to_string(t); return *this; }