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
236
236
// Erases the element at `position` of the `node_hash_map`, returning
237
237
// `void`.
238
238
//
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
+ //
241
246
//
242
247
// iterator erase(const_iterator first, const_iterator last):
243
248
//
Original file line number Diff line number Diff line change @@ -230,8 +230,13 @@ class ABSL_ATTRIBUTE_OWNER node_hash_set
230
230
// Erases the element at `position` of the `node_hash_set`, returning
231
231
// `void`.
232
232
//
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
+ //
235
240
//
236
241
// iterator erase(const_iterator first, const_iterator last):
237
242
//
You can’t perform that action at this time.
0 commit comments