diff --git a/include/nlohmann/detail/iterators/iteration_proxy.hpp b/include/nlohmann/detail/iterators/iteration_proxy.hpp index 3e181d5d9..1b47faeb3 100644 --- a/include/nlohmann/detail/iterators/iteration_proxy.hpp +++ b/include/nlohmann/detail/iterators/iteration_proxy.hpp @@ -39,7 +39,7 @@ template class iteration_proxy_value /// a string representation of the array index mutable string_type array_index_str = "0"; /// an empty string (to return a reference for primitive values) - const string_type empty_str; + const string_type empty_str{}; public: explicit iteration_proxy_value(IteratorType it) noexcept : anchor(it) {} diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 03579b189..30dd96f43 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -3944,7 +3944,7 @@ template class iteration_proxy_value /// a string representation of the array index mutable string_type array_index_str = "0"; /// an empty string (to return a reference for primitive values) - const string_type empty_str; + const string_type empty_str{}; public: explicit iteration_proxy_value(IteratorType it) noexcept : anchor(it) {}