support gcc 4.8.1
This commit is contained in:
parent
6667d0aa39
commit
6756b47d57
@ -4873,7 +4873,13 @@ class basic_json
|
|||||||
// insert to array and return iterator
|
// insert to array and return iterator
|
||||||
iterator result(this);
|
iterator result(this);
|
||||||
assert(m_value.array != nullptr);
|
assert(m_value.array != nullptr);
|
||||||
result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val);
|
#if defined(__GNUC__) && __GNUC__ <= 4 && __GNUC_MINOR__ <= 8
|
||||||
|
auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator);
|
||||||
|
m_value.array->insert(pos.m_it.array_iterator, cnt, val);
|
||||||
|
result.m_it.array_iterator = m_value.array->begin() + insert_pos;
|
||||||
|
#else
|
||||||
|
result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val);
|
||||||
|
#endif
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4939,10 +4945,18 @@ class basic_json
|
|||||||
// insert to array and return iterator
|
// insert to array and return iterator
|
||||||
iterator result(this);
|
iterator result(this);
|
||||||
assert(m_value.array != nullptr);
|
assert(m_value.array != nullptr);
|
||||||
result.m_it.array_iterator = m_value.array->insert(
|
#if defined(__GNUC__) && __GNUC__ <= 4 && __GNUC_MINOR__ <= 8
|
||||||
|
auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator);
|
||||||
|
m_value.array->insert(pos.m_it.array_iterator,
|
||||||
|
first.m_it.array_iterator,
|
||||||
|
last.m_it.array_iterator);
|
||||||
|
result.m_it.array_iterator = m_value.array->begin() + insert_pos;
|
||||||
|
#else
|
||||||
|
result.m_it.array_iterator = m_value.array->insert(
|
||||||
pos.m_it.array_iterator,
|
pos.m_it.array_iterator,
|
||||||
first.m_it.array_iterator,
|
first.m_it.array_iterator,
|
||||||
last.m_it.array_iterator);
|
last.m_it.array_iterator);
|
||||||
|
#endif
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4987,7 +5001,13 @@ class basic_json
|
|||||||
// insert to array and return iterator
|
// insert to array and return iterator
|
||||||
iterator result(this);
|
iterator result(this);
|
||||||
assert(m_value.array != nullptr);
|
assert(m_value.array != nullptr);
|
||||||
result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, ilist);
|
#if defined(__GNUC__) && __GNUC__ <= 4 && __GNUC_MINOR__ <= 8
|
||||||
|
auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator);
|
||||||
|
m_value.array->insert(pos.m_it.array_iterator, ilist);
|
||||||
|
result.m_it.array_iterator = m_value.array->begin() + insert_pos;
|
||||||
|
#else
|
||||||
|
result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, ilist);
|
||||||
|
#endif
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user