keys, sorted by keys   
(class template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/container/dsc_flat_multiset&action=edit)  
[ flat_multimap  ](/w/cpp/container/flat_multimap "cpp/container/flat multimap") (C++23)  |  adapts two containers to provide a collection of key-value pairs, sorted by keys   
(class template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/container/dsc_flat_multimap&action=edit)  
  
###  [ [ edit ](/mwiki/index.php?title=cpp/container&action=edit&section=5
"Edit section: Views") ]  Views

Views provide flexible facilities for interacting with one- or multi-
dimensional views over a non-owning array of elements.

[ span  ](/w/cpp/container/span "cpp/container/span") (C++20)  |  a non-owning view over a contiguous sequence of objects   
(class template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/container/dsc_span&action=edit)  
---|---  
[ mdspan  ](/w/cpp/container/mdspan "cpp/container/mdspan") (C++23)  |  a multi-dimensional non-owning array view   
(class template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/container/dsc_mdspan&action=edit)  
  
###  [ [ edit ](/mwiki/index.php?title=cpp/container&action=edit&section=6
"Edit section: Iterator invalidation") ]  Iterator invalidation

Read-only methods never [ invalidate
](/w/cpp/iterator#Dereferceability_and_validity "cpp/iterator") iterators or
references. Methods which modify the contents of a container may invalidate
iterators and/or references, as summarized in this table.

Category  |  Container  |  After **insertion** , are...  |  After **erasure** , are...  |  Conditionally   
---|---|---|---|---  
**iterators** valid?  |  **references** valid?  |  **iterators** valid?  |  **references** valid?   
Sequence containers  |  [ ` array ` ](/w/cpp/container/array "cpp/container/array") |  N/A  |  N/A  |   
[ ` vector ` ](/w/cpp/container/vector "cpp/container/vector") |  No  |  N/A  |  Insertion changed capacity   
Yes  |  Yes  |  Before modified element(s)   
(for insertion only if capacity didn't change)  
No  |  No  |  At or after modified element(s)   
[ ` deque ` ](/w/cpp/container/deque "cpp/container/deque") |  No  |  Yes  |  Yes, except erased element(s)  |  Modified first or last element   
No  |  No  |  Modified middle only   
[ ` list ` ](/w/cpp/container/list "cpp/container/list") |  Yes  |  Yes, except erased element(s)  |   
[ ` forward_list ` ](/w/cpp/container/forward_list "cpp/container/forward list") |  Yes  |  Yes, except erased element(s)  |   
Associative containers  |  [ ` set ` ](/w/cpp/container/set "cpp/container/set")   
[ ` multiset ` ](/w/cpp/container/multiset "cpp/container/multiset")  
[ ` map ` ](/w/cpp/container/map "cpp/container/map")  
[ ` multimap ` ](/w/cpp/container/multimap "cpp/container/multimap") |  Yes  |  Yes, except erased element(s)  |   
Unordered associative containers  |  [ ` unordered_set ` ](/w/cpp/container/unordered_set "cpp/container/unordered set")   
[ ` unordered_multiset ` ](/w/cpp/container/unordered_multiset
"cpp/container/unordered multiset")  
[ ` unordered_map ` ](/w/cpp/container/unordered_map "cpp/container/unordered
map")  
[ ` unordered_multimap ` ](/w/cpp/container/unordered_multimap "cpp/container/unordered multimap") |  No  |  Yes  |  N/A  |  Insertion caused rehash   
Yes  |  Yes, except erased element(s)  |  No rehash   
|  This section is incomplete  
Reason: iterators from C++23 adaptors  
---|---  
  
Here, **insertion** refers to any method which adds one or more elements to
the container and **erasure** refers to any method which removes one or more
elements from the container.

  * Examples of insertion methods are  [ std::set::insert ](/w/cpp/container/set/insert "cpp/container/set/insert") ,  [ std::map::emplace ](/w/cpp/container/map/emplace "cpp/container/map/emplace") ,  [ std::vector::push_back ](/w/cpp/container/vector/push_back "cpp/conta