diff --git a/include/nlohmann/detail/input/input_adapters.hpp b/include/nlohmann/detail/input/input_adapters.hpp index 9512a771ee..2f33feef67 100644 --- a/include/nlohmann/detail/input/input_adapters.hpp +++ b/include/nlohmann/detail/input/input_adapters.hpp @@ -336,22 +336,28 @@ class input_adapter public: // native support JSON_HEDLEY_NON_NULL(2) + // cppcheck-suppress noExplicitConstructor input_adapter(std::FILE* file) : ia(std::make_shared(file)) {} /// input adapter for input stream + // cppcheck-suppress noExplicitConstructor input_adapter(std::istream& i) : ia(std::make_shared(i)) {} /// input adapter for input stream + // cppcheck-suppress noExplicitConstructor input_adapter(std::istream&& i) : ia(std::make_shared(i)) {} + // cppcheck-suppress noExplicitConstructor input_adapter(const std::wstring& ws) : ia(std::make_shared>(ws)) {} + // cppcheck-suppress noExplicitConstructor input_adapter(const std::u16string& ws) : ia(std::make_shared>(ws)) {} + // cppcheck-suppress noExplicitConstructor input_adapter(const std::u32string& ws) : ia(std::make_shared>(ws)) {} @@ -374,6 +380,7 @@ class input_adapter std::is_integral::type>::value and sizeof(typename std::remove_pointer::type) == 1, int>::type = 0> + // cppcheck-suppress noExplicitConstructor input_adapter(CharT b) : input_adapter(reinterpret_cast(b), std::strlen(reinterpret_cast(b))) {} @@ -418,6 +425,7 @@ class input_adapter /// input adapter for array template + // cppcheck-suppress noExplicitConstructor input_adapter(T (&array)[N]) : input_adapter(std::begin(array), std::end(array)) {} @@ -426,6 +434,7 @@ class input_adapter std::enable_if::value and std::is_base_of()))>::iterator_category>::value, int>::type = 0> + // cppcheck-suppress noExplicitConstructor input_adapter(const ContiguousContainer& c) : input_adapter(std::begin(c), std::end(c)) {} diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 53a0a929a9..64da83032b 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -4199,22 +4199,28 @@ class input_adapter public: // native support JSON_HEDLEY_NON_NULL(2) + // cppcheck-suppress noExplicitConstructor input_adapter(std::FILE* file) : ia(std::make_shared(file)) {} /// input adapter for input stream + // cppcheck-suppress noExplicitConstructor input_adapter(std::istream& i) : ia(std::make_shared(i)) {} /// input adapter for input stream + // cppcheck-suppress noExplicitConstructor input_adapter(std::istream&& i) : ia(std::make_shared(i)) {} + // cppcheck-suppress noExplicitConstructor input_adapter(const std::wstring& ws) : ia(std::make_shared>(ws)) {} + // cppcheck-suppress noExplicitConstructor input_adapter(const std::u16string& ws) : ia(std::make_shared>(ws)) {} + // cppcheck-suppress noExplicitConstructor input_adapter(const std::u32string& ws) : ia(std::make_shared>(ws)) {} @@ -4237,6 +4243,7 @@ class input_adapter std::is_integral::type>::value and sizeof(typename std::remove_pointer::type) == 1, int>::type = 0> + // cppcheck-suppress noExplicitConstructor input_adapter(CharT b) : input_adapter(reinterpret_cast(b), std::strlen(reinterpret_cast(b))) {} @@ -4281,6 +4288,7 @@ class input_adapter /// input adapter for array template + // cppcheck-suppress noExplicitConstructor input_adapter(T (&array)[N]) : input_adapter(std::begin(array), std::end(array)) {} @@ -4289,6 +4297,7 @@ class input_adapter std::enable_if::value and std::is_base_of()))>::iterator_category>::value, int>::type = 0> + // cppcheck-suppress noExplicitConstructor input_adapter(const ContiguousContainer& c) : input_adapter(std::begin(c), std::end(c)) {}