From faccc37d0d99a30c9de6fc4a68f683482a790638 Mon Sep 17 00:00:00 2001 From: Vitaliy Manushkin Date: Sat, 10 Mar 2018 17:19:28 +0300 Subject: [PATCH] dump to alternate implementation of string, as defined in basic_json template --- include/nlohmann/detail/output/output_adapters.hpp | 10 +++++----- include/nlohmann/json.hpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/nlohmann/detail/output/output_adapters.hpp b/include/nlohmann/detail/output/output_adapters.hpp index fe9e1b36..aa6217ec 100644 --- a/include/nlohmann/detail/output/output_adapters.hpp +++ b/include/nlohmann/detail/output/output_adapters.hpp @@ -68,11 +68,11 @@ class output_stream_adapter : public output_adapter_protocol }; /// output adapter for basic_string -template +template> class output_string_adapter : public output_adapter_protocol { public: - explicit output_string_adapter(std::basic_string& s) : str(s) {} + explicit output_string_adapter(StringType& s) : str(s) {} void write_character(CharType c) override { @@ -85,10 +85,10 @@ class output_string_adapter : public output_adapter_protocol } private: - std::basic_string& str; + StringType& str; }; -template +template> class output_adapter { public: @@ -98,7 +98,7 @@ class output_adapter output_adapter(std::basic_ostream& s) : oa(std::make_shared>(s)) {} - output_adapter(std::basic_string& s) + output_adapter(StringType& s) : oa(std::make_shared>(s)) {} operator output_adapter_t() diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 91de782f..a4f2748d 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -1947,7 +1947,7 @@ class basic_json const bool ensure_ascii = false) const { string_t result; - serializer s(detail::output_adapter(result), indent_char); + serializer s(detail::output_adapter(result), indent_char); if (indent >= 0) {