Commit b753cb6e authored by Oleg Endo's avatar Oleg Endo

use std::make_shared

parent f0ca96d4
......@@ -6634,17 +6634,17 @@ class basic_json
static std::shared_ptr<output_adapter<CharType>> create(std::vector<CharType>& vec)
{
return std::shared_ptr<output_adapter>(new output_vector_adapter<CharType>(vec));
return std::make_shared<output_vector_adapter<CharType>>(vec);
}
static std::shared_ptr<output_adapter<CharType>> create(std::ostream& s)
{
return std::shared_ptr<output_adapter>(new output_stream_adapter<CharType>(s));
return std::make_shared<output_stream_adapter<CharType>>(s);
}
static std::shared_ptr<output_adapter<CharType>> create(std::string& s)
{
return std::shared_ptr<output_adapter>(new output_string_adapter<CharType>(s));
return std::make_shared<output_string_adapter<CharType>>(s);
}
};
......@@ -8767,19 +8767,19 @@ class basic_json
/// input adapter for input stream
static std::shared_ptr<input_adapter> create(std::istream& i)
{
return std::shared_ptr<input_adapter>(new cached_input_stream_adapter<16384>(i));
return std::make_shared<cached_input_stream_adapter<16384>> (i);
}
/// input adapter for input stream
static std::shared_ptr<input_adapter> create(std::istream&& i)
{
return std::shared_ptr<input_adapter>(new cached_input_stream_adapter<16384>(i));
return std::make_shared<cached_input_stream_adapter<16384>>(i);
}
/// input adapter for buffer
static std::shared_ptr<input_adapter> create(const char* b, size_t l)
{
return std::shared_ptr<input_adapter>(new input_buffer_adapter(b, l));
return std::make_shared<input_buffer_adapter>(b, l);
}
// derived support
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment