Merge fb686a200b into 54d3cab568
This commit is contained in:
commit
8a17173085
29
src/json.hpp
29
src/json.hpp
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
__ _____ _____ _____
|
__ _____ _____ _____
|
||||||
__| | __| | | | JSON for Modern C++
|
__| | __| | | | JSON for Modern C++
|
||||||
| | |__ | | | | | | version 2.0.0
|
| | |__ | | | | | | version 2.0.0
|
||||||
@ -4891,7 +4891,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
|
||||||
@ -4957,10 +4963,19 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5005,7 +5020,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4891,7 +4891,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
|
||||||
@ -4957,10 +4963,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5005,7 +5019,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