diff --git a/include/nlohmann/detail/output/output_adapters.hpp b/include/nlohmann/detail/output/output_adapters.hpp index 71ca65b92..2b16eac02 100644 --- a/include/nlohmann/detail/output/output_adapters.hpp +++ b/include/nlohmann/detail/output/output_adapters.hpp @@ -102,12 +102,15 @@ template> class output_adapter { public: + // cppcheck-suppress noExplicitConstructor output_adapter(std::vector& vec) : oa(std::make_shared>(vec)) {} + // cppcheck-suppress noExplicitConstructor output_adapter(std::basic_ostream& s) : oa(std::make_shared>(s)) {} + // cppcheck-suppress noExplicitConstructor output_adapter(StringType& s) : oa(std::make_shared>(s)) {} diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 244244078..fb1cf4808 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -11282,12 +11282,15 @@ template> class output_adapter { public: + // cppcheck-suppress noExplicitConstructor output_adapter(std::vector& vec) : oa(std::make_shared>(vec)) {} + // cppcheck-suppress noExplicitConstructor output_adapter(std::basic_ostream& s) : oa(std::make_shared>(s)) {} + // cppcheck-suppress noExplicitConstructor output_adapter(StringType& s) : oa(std::make_shared>(s)) {}