From b266035c71ea07da8d7264b316b922456a3edb94 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 2 Apr 2013 13:42:24 +0200 Subject: [PATCH] fix String::String(Codepoint, CharCount) --- src/string.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/string.hh b/src/string.hh index 213c8fef5..26922c3dd 100644 --- a/src/string.hh +++ b/src/string.hh @@ -20,7 +20,11 @@ public: String(const char* content) : std::string(content) {} String(std::string content) : std::string(std::move(content)) {} explicit String(char content, CharCount count = 1) : std::string((size_t)(int)count, content) {} - explicit String(Codepoint cp, CharCount count = 1) { utf8::dump(back_inserter(*this), cp); } + explicit String(Codepoint cp, CharCount count = 1) + { + while (count-- > 0) + utf8::dump(back_inserter(*this), cp); + } template String(Iterator begin, Iterator end) : std::string(begin, end) {}