utf8::dump uses a copy of the output iterator instead of a reference
This commit is contained in:
parent
8e07e00f18
commit
9f9ad58b39
|
@ -25,8 +25,7 @@ public:
|
||||||
explicit String(Codepoint cp, CharCount count = 1)
|
explicit String(Codepoint cp, CharCount count = 1)
|
||||||
{
|
{
|
||||||
std::string str;
|
std::string str;
|
||||||
auto it = back_inserter(str);
|
utf8::dump(back_inserter(str), cp);
|
||||||
utf8::dump(it, cp);
|
|
||||||
for (CharCount i = 0; i < count; ++i)
|
for (CharCount i = 0; i < count; ++i)
|
||||||
m_content += str;
|
m_content += str;
|
||||||
}
|
}
|
||||||
|
@ -113,8 +112,7 @@ inline String operator"" _str(const char* str, size_t)
|
||||||
inline String codepoint_to_str(Codepoint cp)
|
inline String codepoint_to_str(Codepoint cp)
|
||||||
{
|
{
|
||||||
std::string str;
|
std::string str;
|
||||||
auto it = back_inserter(str);
|
utf8::dump(back_inserter(str), cp);
|
||||||
utf8::dump(it, cp);
|
|
||||||
return String(str);
|
return String(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,7 @@ Codepoint codepoint(Iterator it)
|
||||||
struct invalid_codepoint{};
|
struct invalid_codepoint{};
|
||||||
|
|
||||||
template<typename OutputIterator>
|
template<typename OutputIterator>
|
||||||
void dump(OutputIterator& it, Codepoint cp)
|
void dump(OutputIterator&& it, Codepoint cp)
|
||||||
{
|
{
|
||||||
if (cp <= 0x7F)
|
if (cp <= 0x7F)
|
||||||
*it++ = cp;
|
*it++ = cp;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user