Skip to content

Iterating an object and erasing members #361

Discussion options

You must be logged in to vote

This change has been made on master, the basic_json::erase function return value, previously void, is now an iterator following the last removed element,

array_iterator erase(const_array_iterator pos);
object_iterator erase(const_object_iterator pos);

array_iterator erase(const_array_iterator first, const_array_iterator last); 
object_iterator erase(const_object_iterator first, const_object_iterator last);

Incidentally, instead of it->name(), use it->key(), name() was deprecated a long time ago, that should have resulted in a warning. To be sure that you're not using any deprecated functions, you may want to define the JSONCONS_NO_DEPRECATED macro.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by awolff64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants