New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
object::stable_erase #749
object::stable_erase #749
Conversation
impressive work :) you figured out how |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #749 +/- ##
========================================
Coverage 99.13% 99.13%
========================================
Files 69 69
Lines 6556 6584 +28
========================================
+ Hits 6499 6527 +28
Misses 57 57
Continue to review full report at Codecov.
|
|
|
@grisumbras I guess I have no objection to offering this feature. If the user wants to opt-in to preserving order at a computational cost, I can't see a downside. But its up to you, maybe there's something I haven't thought of? What does Peter think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got nerd sniped by this PR. Nice work :)
@@ -1567,6 +1614,12 @@ class object | |||
destroy( | |||
key_value_pair* first, | |||
key_value_pair* last) noexcept; | |||
|
|||
inline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this use a little javadoc even though it's internal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eh..
by the way docca supports @param first, last The range to destroy
now
include/boost/json/object.hpp
Outdated
@par Exception Safety | ||
No-throw guarantee. | ||
|
||
@return An iterator following the last removed element. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"last" seems redundant here
include/boost/json/object.hpp
Outdated
Remove the element pointed to by `pos`, which must | ||
be valid and dereferenceable. Thus the @ref end() | ||
iterator (which is valid but cannot be dereferenced) | ||
cannot be used as a value for `pos`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentences "Thus the @ref end() iterator (which is valid but cannot be dereferenced) cannot be used as a value for pos
." is redundant.
If this is expected to be a gotcha (?) I'd move it to a note below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is verbatim from https://en.cppreference.com/w/cpp/container/vector/erase. Moved to note section.
|
|
Thanks for the feature. |
Support for erasing an element without reordering. This is part one of support #748, part two would be stable_insert.