diff --git a/src/json.hpp b/src/json.hpp index 612c7e58..1bde08ce 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -43,7 +43,7 @@ SOFTWARE. #include // function, hash, less #include // initializer_list #include // hex -#include // istream, ostream +#include // istream, ostream #include // advance, begin, back_inserter, bidirectional_iterator_tag, distance, end, inserter, iterator, iterator_traits, next, random_access_iterator_tag, reverse_iterator #include // numeric_limits #include // locale @@ -6634,17 +6634,17 @@ class basic_json static std::shared_ptr> create(std::vector& vec) { - return std::shared_ptr(new output_vector_adapter(vec)); + return std::make_shared>(vec); } static std::shared_ptr> create(std::ostream& s) { - return std::shared_ptr(new output_stream_adapter(s)); + return std::make_shared>(s); } static std::shared_ptr> create(std::string& s) { - return std::shared_ptr(new output_string_adapter(s)); + return std::make_shared>(s); } }; @@ -6675,7 +6675,7 @@ class basic_json std::vector& v; }; - /// putput adapter for output streams + /// output adapter for output streams template class output_stream_adapter : public output_adapter { @@ -8767,19 +8767,19 @@ class basic_json /// input adapter for input stream static std::shared_ptr create(std::istream& i) { - return std::shared_ptr(new cached_input_stream_adapter<16384>(i)); + return std::make_shared> (i); } /// input adapter for input stream static std::shared_ptr create(std::istream&& i) { - return std::shared_ptr(new cached_input_stream_adapter<16384>(i)); + return std::make_shared>(i); } /// input adapter for buffer static std::shared_ptr create(const char* b, size_t l) { - return std::shared_ptr(new input_buffer_adapter(b, l)); + return std::make_shared(b, l); } // derived support diff --git a/test/src/unit-readme.cpp b/test/src/unit-readme.cpp index 1b22f1b3..e921c4b6 100644 --- a/test/src/unit-readme.cpp +++ b/test/src/unit-readme.cpp @@ -36,6 +36,7 @@ using nlohmann::json; #include #include #include +#include TEST_CASE("README", "[hide]") { diff --git a/test/src/unit-unicode.cpp b/test/src/unit-unicode.cpp index 9b379d96..e19905d5 100644 --- a/test/src/unit-unicode.cpp +++ b/test/src/unit-unicode.cpp @@ -33,6 +33,7 @@ SOFTWARE. using nlohmann::json; #include +#include extern size_t calls; size_t calls = 0;