From ae48acbb2377543cb066a19580073991134629a5 Mon Sep 17 00:00:00 2001 From: Jonathan Dumaresq Date: Wed, 12 Dec 2018 09:28:42 -0500 Subject: [PATCH] remove non usefull code. Add small description --- include/nlohmann/detail/input/input_adapters.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/nlohmann/detail/input/input_adapters.hpp b/include/nlohmann/detail/input/input_adapters.hpp index 1e200298..f623a230 100644 --- a/include/nlohmann/detail/input/input_adapters.hpp +++ b/include/nlohmann/detail/input/input_adapters.hpp @@ -46,6 +46,10 @@ struct input_adapter_protocol /// a type to simplify interfaces using input_adapter_t = std::shared_ptr; +/*! +Input adapter for stdio file access. This adapter read only 1 byte and do not use any + buffer. This adapter is a very low level adapter. This adapter +*/ class file_input_adapter : public input_adapter_protocol { public: @@ -55,11 +59,7 @@ public: std::char_traits::int_type get_character() noexcept override { - auto res = fgetc(const_cast(file)); - if(res == EOF) - return std::char_traits::eof(); - else - return static_cast::int_type>(res); + return fgetc(const_cast(file)); } private: /// the file pointer to read from