Increment output iterator in basic_writer::write for character types (#1056)

This commit is contained in:
Alexander Bolz
2019-02-26 20:38:03 +01:00
committed by Victor Zverovich
parent a97757736b
commit 287eaab3b2
2 changed files with 28 additions and 2 deletions

View File

@@ -2755,10 +2755,14 @@ template <typename Range> class basic_writer {
void write(long double value) { write_double(value, format_specs()); }
/** Writes a character to the buffer. */
void write(char value) { *reserve(1) = value; }
void write(char value) {
auto&& it = reserve(1);
*it++ = value;
}
void write(wchar_t value) {
static_assert(std::is_same<char_type, wchar_t>::value, "");
*reserve(1) = value;
auto&& it = reserve(1);
*it++ = value;
}
/**