From 72bff90ed955421f4db98f272648afca565b72c8 Mon Sep 17 00:00:00 2001 From: "Matthew K. Gumbel" Date: Mon, 4 Dec 2017 15:42:08 -0800 Subject: [PATCH] :wrench: Fix up a few more effc++ items --- src/json.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index ae363ba7..4ffe5a6a 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -3526,7 +3526,7 @@ class primitive_iterator_t return *this; } - primitive_iterator_t operator++(int) + primitive_iterator_t const operator++(int) { auto result = *this; m_it++; @@ -3539,7 +3539,7 @@ class primitive_iterator_t return *this; } - primitive_iterator_t operator--(int) + primitive_iterator_t const operator--(int) { auto result = *this; m_it--; @@ -3850,7 +3850,7 @@ class iter_impl @brief post-increment (it++) @pre The iterator is initialized; i.e. `m_object != nullptr`. */ - iter_impl operator++(int) + iter_impl const operator++(int) { auto result = *this; ++(*this); @@ -3893,7 +3893,7 @@ class iter_impl @brief post-decrement (it--) @pre The iterator is initialized; i.e. `m_object != nullptr`. */ - iter_impl operator--(int) + iter_impl const operator--(int) { auto result = *this; --(*this); @@ -4299,7 +4299,7 @@ class json_reverse_iterator : public std::reverse_iterator json_reverse_iterator(const base_iterator& it) noexcept : base_iterator(it) {} /// post-increment (it++) - json_reverse_iterator operator++(int) + json_reverse_iterator const operator++(int) { return static_cast(base_iterator::operator++(1)); } @@ -4311,7 +4311,7 @@ class json_reverse_iterator : public std::reverse_iterator } /// post-decrement (it--) - json_reverse_iterator operator--(int) + json_reverse_iterator const operator--(int) { return static_cast(base_iterator::operator--(1)); } @@ -6567,7 +6567,8 @@ class serializer // the codepoint from the UTF-8 bytes int codepoint = 0; - assert(0 <= bytes and bytes <= 3); + // bytes is unsigned type: + assert(bytes <= 3); switch (bytes) { case 0: @@ -7046,7 +7047,6 @@ class json_pointer return result; } - /*! @brief create and return a reference to the pointed to value