use the current fill char when piping to a stream

This commit is contained in:
Francois Chabot 2020-06-05 16:30:21 -04:00
parent bf55a999c5
commit f072b97eb2
2 changed files with 4 additions and 4 deletions

View File

@ -6523,12 +6523,12 @@ class basic_json
{
// read width member and use it as indentation parameter if nonzero
const bool pretty_print = o.width() > 0;
const auto indentation = pretty_print ? o.width() : 0;
const auto indentation = pretty_print ? o.width() : -1;
// reset width to 0 for subsequent calls to this stream
o.width(0);
j.dump_to(o, indentation, ' ', false);
j.dump_to(o, indentation, o.fill(), false);
return o;
}

View File

@ -22313,12 +22313,12 @@ class basic_json
{
// read width member and use it as indentation parameter if nonzero
const bool pretty_print = o.width() > 0;
const auto indentation = pretty_print ? o.width() : 0;
const auto indentation = pretty_print ? o.width() : -1;
// reset width to 0 for subsequent calls to this stream
o.width(0);
j.dump_to(o, indentation, ' ', false);
j.dump_to(o, indentation, o.fill(), false);
return o;
}