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

iteration_proxy: Fix integer truncation from std::size_t to int #1797

Merged
merged 1 commit into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion include/nlohmann/detail/iterators/iteration_proxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace nlohmann
namespace detail
{
template<typename string_type>
void int_to_string( string_type& target, int value )
void int_to_string( string_type& target, std::size_t value )
{
target = std::to_string(value);
}
Expand Down
2 changes: 1 addition & 1 deletion single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3187,7 +3187,7 @@ namespace nlohmann
namespace detail
{
template<typename string_type>
void int_to_string( string_type& target, int value )
void int_to_string( string_type& target, std::size_t value )
{
target = std::to_string(value);
}
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-alt-string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class alt_string
friend bool ::operator<(const char*, const alt_string&);
};

void int_to_string( alt_string& target, int value )
void int_to_string( alt_string& target, std::size_t value )
{
target = std::to_string(value).c_str();
}
Expand Down