using std::advance where possible
This commit is contained in:
parent
a0609b2da3
commit
52cbda8048
2 changed files with 12 additions and 12 deletions
12
src/json.hpp
12
src/json.hpp
|
@ -6606,13 +6606,13 @@ class basic_json
|
|||
{
|
||||
case basic_json::value_t::object:
|
||||
{
|
||||
++m_it.object_iterator;
|
||||
std::advance(m_it.object_iterator, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
case basic_json::value_t::array:
|
||||
{
|
||||
++m_it.array_iterator;
|
||||
std::advance(m_it.array_iterator, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -6643,13 +6643,13 @@ class basic_json
|
|||
{
|
||||
case basic_json::value_t::object:
|
||||
{
|
||||
--m_it.object_iterator;
|
||||
std::advance(m_it.object_iterator, -1);
|
||||
break;
|
||||
}
|
||||
|
||||
case basic_json::value_t::array:
|
||||
{
|
||||
--m_it.array_iterator;
|
||||
std::advance(m_it.array_iterator, -1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -6761,7 +6761,7 @@ class basic_json
|
|||
|
||||
case basic_json::value_t::array:
|
||||
{
|
||||
m_it.array_iterator += i;
|
||||
std::advance(m_it.array_iterator, i);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -6835,7 +6835,7 @@ class basic_json
|
|||
|
||||
case basic_json::value_t::array:
|
||||
{
|
||||
return *(m_it.array_iterator + n);
|
||||
return *std::next(m_it.array_iterator, n);
|
||||
}
|
||||
|
||||
case basic_json::value_t::null:
|
||||
|
|
|
@ -6606,13 +6606,13 @@ class basic_json
|
|||
{
|
||||
case basic_json::value_t::object:
|
||||
{
|
||||
++m_it.object_iterator;
|
||||
std::advance(m_it.object_iterator, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
case basic_json::value_t::array:
|
||||
{
|
||||
++m_it.array_iterator;
|
||||
std::advance(m_it.array_iterator, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -6643,13 +6643,13 @@ class basic_json
|
|||
{
|
||||
case basic_json::value_t::object:
|
||||
{
|
||||
--m_it.object_iterator;
|
||||
std::advance(m_it.object_iterator, -1);
|
||||
break;
|
||||
}
|
||||
|
||||
case basic_json::value_t::array:
|
||||
{
|
||||
--m_it.array_iterator;
|
||||
std::advance(m_it.array_iterator, -1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -6761,7 +6761,7 @@ class basic_json
|
|||
|
||||
case basic_json::value_t::array:
|
||||
{
|
||||
m_it.array_iterator += i;
|
||||
std::advance(m_it.array_iterator, i);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -6835,7 +6835,7 @@ class basic_json
|
|||
|
||||
case basic_json::value_t::array:
|
||||
{
|
||||
return *(m_it.array_iterator + n);
|
||||
return *std::next(m_it.array_iterator, n);
|
||||
}
|
||||
|
||||
case basic_json::value_t::null:
|
||||
|
|
Loading…
Reference in a new issue