Talk:cpp/container/unordered map/insert
From cppreference.com
< Talk:cpp | container | unordered map
[edit] Iterator Invalidation
The standard defines (23.5.4.4):
Effects: Inserts obj converted to value_type if and only if there is no element in the container with key equivalent to the key of value_type(obj).
— Preceding unsigned comment added by ReDucTor (talk • contribs)
- Can you elaborate? What is incorrect, and how? T. Canens (talk) 18:57, 11 January 2016 (PST)
- "If rehashing occurs due to the insertion, all iterators are invalidated. Otherwise iterators are not affected. " This statement is incorrect. Iterators are not invalidated. --ReDucTor (talk) 13:03, 12 January 2016 (PST)
- No, it's correct as written. [unord.req]/9, 14-15. T. Canens (talk) 13:26, 12 January 2016 (PST)
- "If rehashing occurs due to the insertion, all iterators are invalidated. Otherwise iterators are not affected. " This statement is incorrect. Iterators are not invalidated. --ReDucTor (talk) 13:03, 12 January 2016 (PST)