Commit a0e05793 authored by Niels Lohmann's avatar Niels Lohmann Committed by GitHub

Merge pull request #650 from olegendo/develop

Don't include <iostream>, use std::make_shared
parents 1b2fabe8 e3bb156f
...@@ -43,7 +43,7 @@ SOFTWARE. ...@@ -43,7 +43,7 @@ SOFTWARE.
#include <functional> // function, hash, less #include <functional> // function, hash, less
#include <initializer_list> // initializer_list #include <initializer_list> // initializer_list
#include <iomanip> // hex #include <iomanip> // hex
#include <iostream> // istream, ostream #include <iosfwd> // istream, ostream
#include <iterator> // advance, begin, back_inserter, bidirectional_iterator_tag, distance, end, inserter, iterator, iterator_traits, next, random_access_iterator_tag, reverse_iterator #include <iterator> // advance, begin, back_inserter, bidirectional_iterator_tag, distance, end, inserter, iterator, iterator_traits, next, random_access_iterator_tag, reverse_iterator
#include <limits> // numeric_limits #include <limits> // numeric_limits
#include <locale> // locale #include <locale> // locale
...@@ -6634,17 +6634,17 @@ class basic_json ...@@ -6634,17 +6634,17 @@ class basic_json
static std::shared_ptr<output_adapter<CharType>> create(std::vector<CharType>& vec) 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) 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) 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);
} }
}; };
...@@ -6675,7 +6675,7 @@ class basic_json ...@@ -6675,7 +6675,7 @@ class basic_json
std::vector<CharType>& v; std::vector<CharType>& v;
}; };
/// putput adapter for output streams /// output adapter for output streams
template<typename CharType> template<typename CharType>
class output_stream_adapter : public output_adapter<CharType> class output_stream_adapter : public output_adapter<CharType>
{ {
...@@ -8767,19 +8767,19 @@ class basic_json ...@@ -8767,19 +8767,19 @@ class basic_json
/// input adapter for input stream /// input adapter for input stream
static std::shared_ptr<input_adapter> create(std::istream& i) 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 /// input adapter for input stream
static std::shared_ptr<input_adapter> create(std::istream&& i) 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 /// input adapter for buffer
static std::shared_ptr<input_adapter> create(const char* b, size_t l) 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 // derived support
......
...@@ -36,6 +36,7 @@ using nlohmann::json; ...@@ -36,6 +36,7 @@ using nlohmann::json;
#include <list> #include <list>
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
#include <iostream>
TEST_CASE("README", "[hide]") TEST_CASE("README", "[hide]")
{ {
......
...@@ -33,6 +33,7 @@ SOFTWARE. ...@@ -33,6 +33,7 @@ SOFTWARE.
using nlohmann::json; using nlohmann::json;
#include <fstream> #include <fstream>
#include <iostream>
extern size_t calls; extern size_t calls;
size_t calls = 0; size_t calls = 0;
......
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