diff --git a/include/nlohmann/detail/output/output_adapters.hpp b/include/nlohmann/detail/output/output_adapters.hpp index 1cad57b19..f2a230320 100644 --- a/include/nlohmann/detail/output/output_adapters.hpp +++ b/include/nlohmann/detail/output/output_adapters.hpp @@ -53,7 +53,7 @@ class output_vector_adapter : public output_adapter_protocol JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { - std::copy(s, s + length, std::back_inserter(v)); + v.insert(v.end(), s, s + length); } private: diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 50e5c805c..41827a4b1 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -14247,7 +14247,7 @@ class output_vector_adapter : public output_adapter_protocol JSON_HEDLEY_NON_NULL(2) void write_characters(const CharType* s, std::size_t length) override { - std::copy(s, s + length, std::back_inserter(v)); + v.insert(v.end(), s, s + length); } private: