1
0
mirror of https://github.com/nlohmann/json.git synced 2025-08-07 18:02:57 +03:00

Fix char_traits deprecation warning (#4179)

This commit is contained in:
Colby Haskell
2023-11-27 00:51:25 -05:00
committed by GitHub
parent f56c6e2e30
commit 1d597743d8
5 changed files with 172 additions and 50 deletions

View File

@@ -25,6 +25,7 @@
#include <nlohmann/detail/iterators/iterator_traits.hpp>
#include <nlohmann/detail/macro_scope.hpp>
#include <nlohmann/detail/meta/type_traits.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
@@ -144,16 +145,16 @@ class iterator_input_adapter
: current(std::move(first)), end(std::move(last))
{}
typename std::char_traits<char_type>::int_type get_character()
typename char_traits<char_type>::int_type get_character()
{
if (JSON_HEDLEY_LIKELY(current != end))
{
auto result = std::char_traits<char_type>::to_int_type(*current);
auto result = char_traits<char_type>::to_int_type(*current);
std::advance(current, 1);
return result;
}
return std::char_traits<char_type>::eof();
return char_traits<char_type>::eof();
}
private: