diff --git a/include/nlohmann/detail/input/input_adapters.hpp b/include/nlohmann/detail/input/input_adapters.hpp index 0f8d5c3c9..4ac750e8e 100644 --- a/include/nlohmann/detail/input/input_adapters.hpp +++ b/include/nlohmann/detail/input/input_adapters.hpp @@ -150,6 +150,11 @@ struct char_traits : std::char_traits { return static_cast(c); } + + static int_type eof() + { + return static_cast(EOF); + } }; // Explicitly define char traits for signed char since it is not standard diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 3b2765656..2e667b40a 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -6233,6 +6233,11 @@ struct char_traits : std::char_traits { return static_cast(c); } + + static int_type eof() + { + return static_cast(EOF); + } }; // Explicitly define char traits for signed char since it is not standard