Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix consistency in function int_to_string() #2193

Merged
merged 3 commits into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions include/nlohmann/detail/iterators/iteration_proxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ namespace nlohmann
{
namespace detail
{
template<typename string_type>
template<typename string_type, typename std::enable_if<
dota17 marked this conversation as resolved.
Show resolved Hide resolved
std::is_same<char, typename string_type::value_type>::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 <typename IteratorType> class iteration_proxy_value
{
Expand Down
7 changes: 5 additions & 2 deletions single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3650,10 +3650,13 @@ namespace nlohmann
{
namespace detail
{
template<typename string_type>
template<typename string_type, typename std::enable_if<
std::is_same<char, typename string_type::value_type>::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 <typename IteratorType> class iteration_proxy_value
{
Expand Down