add string writing support to string buffer
parent
d883adaf5c
commit
f15a89328f
|
@ -34,12 +34,15 @@ namespace blt::string {
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuffer& operator<<(char c);
|
StringBuffer& operator<<(char c);
|
||||||
|
StringBuffer& operator<<(const std::string& str) {
|
||||||
|
for (char c : str)
|
||||||
|
*this << str;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline StringBuffer& operator<<(T t) {
|
inline StringBuffer& operator<<(T t) {
|
||||||
auto str = std::to_string(t);
|
*this << std::to_string(t);
|
||||||
for (char c : str)
|
|
||||||
*this << c;
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue