From f1a5733272040ddd7c6332396d90adf4be015f43 Mon Sep 17 00:00:00 2001 From: amassalha Date: Tue, 23 Jan 2024 16:08:19 +0200 Subject: [PATCH 1/2] make cbegin and cend functions const Change const iterator functions to const --- include/jsoncons/basic_json.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/jsoncons/basic_json.hpp b/include/jsoncons/basic_json.hpp index c50ef4f841..9826e7e2d4 100644 --- a/include/jsoncons/basic_json.hpp +++ b/include/jsoncons/basic_json.hpp @@ -354,11 +354,11 @@ namespace jsoncons { { return last_; } - const_iterator cbegin() + const_iterator cbegin() const { return first_; } - const_iterator cend() + const_iterator cend() const { return last_; } @@ -370,11 +370,11 @@ namespace jsoncons { { return reverse_iterator(first_); } - const_reverse_iterator crbegin() + const_reverse_iterator crbegin() const { return reverse_iterator(last_); } - const_reverse_iterator crend() + const_reverse_iterator crend() const { return reverse_iterator(first_); } From 0e0341db6ce38d5c655bae2f60b0be2c5e70ef42 Mon Sep 17 00:00:00 2001 From: amassalha Date: Wed, 24 Jan 2024 06:51:12 +0200 Subject: [PATCH 2/2] Update basic_json.hpp --- include/jsoncons/basic_json.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/jsoncons/basic_json.hpp b/include/jsoncons/basic_json.hpp index 9826e7e2d4..6cd893e792 100644 --- a/include/jsoncons/basic_json.hpp +++ b/include/jsoncons/basic_json.hpp @@ -354,11 +354,11 @@ namespace jsoncons { { return last_; } - const_iterator cbegin() const + const_iterator cbegin() const noexcept { return first_; } - const_iterator cend() const + const_iterator cend() const noexcept { return last_; } @@ -370,11 +370,11 @@ namespace jsoncons { { return reverse_iterator(first_); } - const_reverse_iterator crbegin() const + const_reverse_iterator crbegin() const noexcept { return reverse_iterator(last_); } - const_reverse_iterator crend() const + const_reverse_iterator crend() const noexcept { return reverse_iterator(first_); }