From b753cb6ee75cc59559b1f9976b62efae25bb76f7 Mon Sep 17 00:00:00 2001 From: Oleg Endo Date: Sun, 9 Jul 2017 15:19:08 +0900 Subject: [PATCH] use std::make_shared --- src/json.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index b378c77d..abf6b1f6 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -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); } }; @@ -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