mirror of
https://github.com/nlohmann/json.git
synced 2026-11-06 04:39:20 +00:00
iteration_proxy: Fix integer truncation from std::size_t to int
Bug introduced in 0f073e26 (Allow items() to be used with custom string,
2019-09-26).
This commit is contained in:
1 parent
ed5541440a
commit
35b47c2793
3 files changed
+3
-3
No files matched your search
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3187,7 +3187,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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user