From daea213b44135f63409136bbd20cfae2f63b1aa6 Mon Sep 17 00:00:00 2001 From: HenryLee Date: Mon, 29 May 2017 23:56:21 +1000 Subject: [PATCH] Use static cast in the implementation of the operators of reverse iterator --- src/json.hpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index 13b62ded..5c7074f4 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -8638,46 +8638,43 @@ class basic_json /// post-increment (it++) json_reverse_iterator operator++(int) { - return base_iterator::operator++(1); + return static_cast(base_iterator::operator++(1)); } /// pre-increment (++it) json_reverse_iterator& operator++() { - base_iterator::operator++(); - return *this; + return static_cast(base_iterator::operator++()); } /// post-decrement (it--) json_reverse_iterator operator--(int) { - return base_iterator::operator--(1); + return static_cast(base_iterator::operator--(1)); } /// pre-decrement (--it) json_reverse_iterator& operator--() { - base_iterator::operator--(); - return *this; + return static_cast(base_iterator::operator--()); } /// add to iterator json_reverse_iterator& operator+=(difference_type i) { - base_iterator::operator+=(i); - return *this; + return static_cast(base_iterator::operator+=(i)); } /// add to iterator json_reverse_iterator operator+(difference_type i) const { - return json_reverse_iterator(base_iterator::operator+(i)); + return static_cast(base_iterator::operator+(i)); } /// subtract from iterator json_reverse_iterator operator-(difference_type i) const { - return json_reverse_iterator(base_iterator::operator-(i)); + return static_cast(base_iterator::operator-(i)); } /// return difference