From aeef50709e6a49f5807cdf787473ca8adecbe23c Mon Sep 17 00:00:00 2001 From: chenguoping Date: Mon, 22 Jun 2020 20:17:56 +0800 Subject: [PATCH] to allow for ADL in int_to_string() function --- include/nlohmann/detail/iterators/iteration_proxy.hpp | 4 +++- single_include/nlohmann/json.hpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/nlohmann/detail/iterators/iteration_proxy.hpp b/include/nlohmann/detail/iterators/iteration_proxy.hpp index 48927b018..d19be4ddd 100644 --- a/include/nlohmann/detail/iterators/iteration_proxy.hpp +++ b/include/nlohmann/detail/iterators/iteration_proxy.hpp @@ -16,7 +16,9 @@ template::value, int>::type = 0> void int_to_string( string_type& target, std::size_t value ) { - target = std::to_string(value); + // For ADL + using std::to_string; + target = to_string(value); } template class iteration_proxy_value { diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 69a4ec092..58b12a7df 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -3654,7 +3654,9 @@ template::value, int>::type = 0> void int_to_string( string_type& target, std::size_t value ) { - target = std::to_string(value); + // For ADL + using std::to_string; + target = to_string(value); } template class iteration_proxy_value {