Previously the un/associative container overloads for formatter::write
were broken because it failed to find an overload for
write(output_stream, pair).
To fix this we make the write(output_stream<char>&, state, Iter, Iter)
overload actually write(output_stream, state, pair) so that the
existing overload that handles pair can be found.
Further we fix the fallback write(output_stream, state, T) overload to
call formatter::write recursively with the state stripped instead of
calling to_json. This keeps the recursive zero-copy nature of
formatter::write intact.
All of the above mirrors how the existing overloads for to_json
already work.
Previously the un/associative container overloads for
formatter::write
were broken because it failed to find an overload forwrite(output_stream, pair)
.To fix this we make the
write(output_stream<char>&, state, Iter, Iter)
overload actuallywrite(output_stream, state, pair)
so that the existing overload that handlespair
can be found.Further we fix the fallback
write(output_stream, state, T)
overload to callformatter::write
recursively with the state stripped instead of callingto_json
. This keeps the recursive zero-copy nature offormatter::write
intact.All of the above mirrors how the existing overloads for
to_json
already work.Adds some tests as well.