Use static cast in the implementation of the operators of reverse iterator
This commit is contained in:
parent
0c2ed00ebe
commit
daea213b44
1 changed files with 7 additions and 10 deletions
17
src/json.hpp
17
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<json_reverse_iterator>(base_iterator::operator++(1));
|
||||
}
|
||||
|
||||
/// pre-increment (++it)
|
||||
json_reverse_iterator& operator++()
|
||||
{
|
||||
base_iterator::operator++();
|
||||
return *this;
|
||||
return static_cast<json_reverse_iterator&>(base_iterator::operator++());
|
||||
}
|
||||
|
||||
/// post-decrement (it--)
|
||||
json_reverse_iterator operator--(int)
|
||||
{
|
||||
return base_iterator::operator--(1);
|
||||
return static_cast<json_reverse_iterator>(base_iterator::operator--(1));
|
||||
}
|
||||
|
||||
/// pre-decrement (--it)
|
||||
json_reverse_iterator& operator--()
|
||||
{
|
||||
base_iterator::operator--();
|
||||
return *this;
|
||||
return static_cast<json_reverse_iterator&>(base_iterator::operator--());
|
||||
}
|
||||
|
||||
/// add to iterator
|
||||
json_reverse_iterator& operator+=(difference_type i)
|
||||
{
|
||||
base_iterator::operator+=(i);
|
||||
return *this;
|
||||
return static_cast<json_reverse_iterator&>(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<json_reverse_iterator>(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<json_reverse_iterator>(base_iterator::operator-(i));
|
||||
}
|
||||
|
||||
/// return difference
|
||||
|
|
Loading…
Reference in a new issue