From 23857da10e68424195ff8c3c976ec2efbbc6af9e Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 14 Apr 2022 14:35:55 +0200 Subject: [PATCH] tidying up code, no change to logic --- include/nlohmann/detail/input/input_adapters.hpp | 8 ++++---- single_include/nlohmann/json.hpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/nlohmann/detail/input/input_adapters.hpp b/include/nlohmann/detail/input/input_adapters.hpp index 034ca431d..5464fa919 100644 --- a/include/nlohmann/detail/input/input_adapters.hpp +++ b/include/nlohmann/detail/input/input_adapters.hpp @@ -158,14 +158,14 @@ class iterator_input_adapter } private: - IteratorType current; - IteratorType end; - bool current_has_been_consumed = false; + mutable IteratorType current; + const IteratorType end; + mutable bool current_has_been_consumed; template friend struct wide_string_input_helper; - bool empty() + bool empty() const { if (JSON_HEDLEY_LIKELY(current_has_been_consumed)) { diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index d67eb31da..c39bf7a09 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -5869,14 +5869,14 @@ class iterator_input_adapter } private: - IteratorType current; - IteratorType end; - bool current_has_been_consumed = false; + mutable IteratorType current; + const IteratorType end; + mutable bool current_has_been_consumed; template friend struct wide_string_input_helper; - bool empty() + bool empty() const { if (JSON_HEDLEY_LIKELY(current_has_been_consumed)) {