Merge pull request #1797 from t-b/fix-integer-truncation

iteration_proxy: Fix integer truncation from std::size_t to int
This commit is contained in:
Niels Lohmann 2019-10-17 21:02:48 +02:00 committed by GitHub
commit 0245ae5157
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -13,7 +13,7 @@ namespace nlohmann
namespace detail namespace detail
{ {
template<typename string_type> 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); target = std::to_string(value);
} }

View file

@ -3277,7 +3277,7 @@ namespace nlohmann
namespace detail namespace detail
{ {
template<typename string_type> 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); target = std::to_string(value);
} }

View file

@ -154,7 +154,7 @@ class alt_string
friend bool ::operator<(const char*, const 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(); target = std::to_string(value).c_str();
} }