add template for string buffer

v1
Brett 2023-07-10 18:54:04 -04:00
parent d06c7ebeb6
commit 5426aa8359
1 changed files with 8 additions and 0 deletions

View File

@ -35,6 +35,14 @@ namespace blt::string {
StringBuffer& operator<<(char c); StringBuffer& operator<<(char c);
template<typename T>
inline StringBuffer& operator<<(T t) {
auto str = std::to_string(t);
for (char c : str)
*this << c;
return *this;
}
~StringBuffer() { ~StringBuffer() {
free(characterBuffer); free(characterBuffer);
} }