mirror of
https://github.com/nlohmann/json.git
synced 2024-08-23 05:22:28 +02:00
Use static cast in the implementation of the operators of reverse iterator
This commit is contained in:
parent
0c2ed00ebe
commit
daea213b44
17
src/json.hpp
17
src/json.hpp
|
@ -8638,46 +8638,43 @@ class basic_json
|
||||||
/// post-increment (it++)
|
/// post-increment (it++)
|
||||||
json_reverse_iterator operator++(int)
|
json_reverse_iterator operator++(int)
|
||||||
{
|
{
|
||||||
return base_iterator::operator++(1);
|
return static_cast<json_reverse_iterator>(base_iterator::operator++(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// pre-increment (++it)
|
/// pre-increment (++it)
|
||||||
json_reverse_iterator& operator++()
|
json_reverse_iterator& operator++()
|
||||||
{
|
{
|
||||||
base_iterator::operator++();
|
return static_cast<json_reverse_iterator&>(base_iterator::operator++());
|
||||||
return *this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// post-decrement (it--)
|
/// post-decrement (it--)
|
||||||
json_reverse_iterator operator--(int)
|
json_reverse_iterator operator--(int)
|
||||||
{
|
{
|
||||||
return base_iterator::operator--(1);
|
return static_cast<json_reverse_iterator>(base_iterator::operator--(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// pre-decrement (--it)
|
/// pre-decrement (--it)
|
||||||
json_reverse_iterator& operator--()
|
json_reverse_iterator& operator--()
|
||||||
{
|
{
|
||||||
base_iterator::operator--();
|
return static_cast<json_reverse_iterator&>(base_iterator::operator--());
|
||||||
return *this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// add to iterator
|
/// add to iterator
|
||||||
json_reverse_iterator& operator+=(difference_type i)
|
json_reverse_iterator& operator+=(difference_type i)
|
||||||
{
|
{
|
||||||
base_iterator::operator+=(i);
|
return static_cast<json_reverse_iterator&>(base_iterator::operator+=(i));
|
||||||
return *this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// add to iterator
|
/// add to iterator
|
||||||
json_reverse_iterator operator+(difference_type i) const
|
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
|
/// subtract from iterator
|
||||||
json_reverse_iterator operator-(difference_type i) const
|
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
|
/// return difference
|
||||||
|
|
Loading…
Reference in a new issue