File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -236,8 +236,13 @@ class ABSL_ATTRIBUTE_OWNER node_hash_map
236236 // Erases the element at `position` of the `node_hash_map`, returning
237237 // `void`.
238238 //
239- // NOTE: this return behavior is different than that of STL containers in
240- // general and `std::unordered_map` in particular.
239+ // NOTE: Returning `void` in this case is different than that of STL
240+ // containers in general and `std::unordered_map` in particular (which
241+ // return an iterator to the element following the erased element). If that
242+ // iterator is needed, simply post increment the iterator:
243+ //
244+ // map.erase(it++);
245+ //
241246 //
242247 // iterator erase(const_iterator first, const_iterator last):
243248 //
Original file line number Diff line number Diff line change @@ -230,8 +230,13 @@ class ABSL_ATTRIBUTE_OWNER node_hash_set
230230 // Erases the element at `position` of the `node_hash_set`, returning
231231 // `void`.
232232 //
233- // NOTE: this return behavior is different than that of STL containers in
234- // general and `std::unordered_set` in particular.
233+ // NOTE: Returning `void` in this case is different than that of STL
234+ // containers in general and `std::unordered_map` in particular (which
235+ // return an iterator to the element following the erased element). If that
236+ // iterator is needed, simply post increment the iterator:
237+ //
238+ // map.erase(it++);
239+ //
235240 //
236241 // iterator erase(const_iterator first, const_iterator last):
237242 //
You can’t perform that action at this time.
0 commit comments