object::stable_insert
This is for inserting values at any position in the object preserving order of all elements (at the cost of linear complexity). Part 2/2 of https://github.com/boostorg/json/issues/748.
This does not have the bug https://github.com/boostorg/json/issues/763 since care is taken to avoid allocation unless necessary.
Codecov Report
Merging #765 (d854374) into develop (ce144b5) will decrease coverage by
0.16%. The diff coverage is100.00%.
Additional details and impacted files
@@ Coverage Diff @@
## develop #765 +/- ##
===========================================
- Coverage 99.13% 98.97% -0.17%
===========================================
Files 69 69
Lines 6587 6623 +36
===========================================
+ Hits 6530 6555 +25
- Misses 57 68 +11
| Impacted Files | Coverage Δ | |
|---|---|---|
| include/boost/json/object.hpp | 100.00% <ø> (ø) |
|
| include/boost/json/impl/object.hpp | 100.00% <100.00%> (ø) |
|
| include/boost/json/impl/object.ipp | 100.00% <100.00%> (ø) |
|
| include/boost/json/basic_parser_impl.hpp | 98.33% <0.00%> (-0.88%) |
:arrow_down: |
| include/boost/json/detail/config.hpp | 100.00% <0.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update ce144b5...d854374. Read the comment docs.
Benchmark test results. More info at https://benchmark.cppalliance.org/jsonbenchmarks-pullrequests/765/pullrequest.html
One thing that could reduce duplication is to implement insert in terms of stable_insert_impl using pos as end().