diff --git a/octa/io.hh b/octa/io.hh index 94dee77..07c439f 100644 --- a/octa/io.hh +++ b/octa/io.hh @@ -151,6 +151,6 @@ static inline void writeln(const T &v, const A &...args) { putc('\n', ::stdout); } -} +} /* namespace octa */ #endif \ No newline at end of file diff --git a/octa/string.hh b/octa/string.hh index 8a8dd34..2eedd78 100644 --- a/octa/string.hh +++ b/octa/string.hh @@ -115,6 +115,7 @@ struct StringRangeBase: InputRange< T &operator[](octa::Size i) const { return p_beg[i]; } void put(T v) { + if (empty()) return; *(p_beg++) = v; } @@ -156,6 +157,9 @@ public: StringBase(const A &a = A()): p_buf(1, '\0', a) {} + StringBase(Size n, const T &val = T(), const A &al = A()): + p_buf(n + 1, val, al) {} + StringBase(const StringBase &s): p_buf(s.p_buf) {} StringBase(const StringBase &s, const A &a): p_buf(s.p_buf, a) {}