From f4a8d2d97fce0783a4c0cc08231cdc30c5dba135 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 49d04395c..e693f235b 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 fdcf4e818..f4fd494df 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -5568,14 +5568,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)) {