Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
json_formatter: Make formatter::write work for std::pair
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` recurisvely 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.
- Loading branch information