diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-04-02 13:42:24 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-04-02 13:42:24 +0200 |
| commit | b266035c71ea07da8d7264b316b922456a3edb94 (patch) | |
| tree | a33f612f2478c401d0139b40f45b72c661304fc4 /src/string.hh | |
| parent | 136f1a628472559d53a9f9f44406a1331f6bec34 (diff) | |
fix String::String(Codepoint, CharCount)
Diffstat (limited to 'src/string.hh')
| -rw-r--r-- | src/string.hh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/string.hh b/src/string.hh index 213c8fef..26922c3d 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<typename Iterator> String(Iterator begin, Iterator end) : std::string(begin, end) {} |
