C++ concepts: AssociativeContainer
From cppreference.com
                    
                                        
                    
                    
                                                            
                    An AssociativeContainer is an ordered Container that provides fast lookup of objects based on keys.
[edit] Requirements
| Legend | |
| X | Container type | 
| a | Object of type X | 
| a_uniq | Object in XwhenXsupports unique keys | 
| a_eq | Object in XwhenXsupports multiple keys | 
| a_trans | Object in Xwhen typeX::key_compare::is_transparentexists | 
| i,j | InputIterators denoting a valid range | 
| p | const_iterator to a | 
| q | dereferenceable const_iterator to a | 
| q1,q2 | const_iterators denoting a valid range in a | 
| il | std::initializer_list<value_type> | 
| t | Object of type X::value_type | 
| k | Object of type X::key_type | 
| c | Object of type X::key_compare | 
| A | Storage allocator used by X, or std::allocator_type<X::value_type> | 
| m | Allocator of a type convertible to A | 
| expression | return type | pre/requirements | post/effects | complexity | 
|---|---|---|---|---|
| X::key_type | Key | KeyisDestructible | compile time | |
| X::key_compare | Compare | compile time | ||
| X::value_compare | a type satisfying BinaryPredicate | key_compare for std::set and std::multiset; an ordering relation over Keyfor std::map and std::multimap | compile time | |
| X(c), X a(c); | key_compare is CopyConstructible | Construct an empty container using a copy of c as key_comp | constant | |
| X(), X a; | key_compare is CopyConstructible | Construct an empty container using a Compare() as key_comp | constant | |
| X(i, j, c), X a(i, j, c); | key_compare is CopyConstructibleand value_type isEmplaceConstructibleinto X from *i | Constructs an empty container using a copy of c as key_compand inserts all elements from the range[i; j) | generally N log N, orNif[i, j)is sorted (whereNis std::distance(i, j)) | |
| X(i, j), X a(i, j); | key_compare is CopyConstructibleand value_type isEmplaceConstructibleinto X from *i | Constructs an empty container using a Compare() as key_compand inserts all elements from the range[i; j) | generally N log N, orNif[i, j)is sorted according to value_comp() (whereNis std::distance(i, j)) | |
| X(il); | Equivalent to X(il.begin(), il.end()); | Equivalent to X(il.begin(), il.end()); | ||
| a = il | X& | TisCopyInsertableintoXand alsoCopyAssignable | Assign the range [il.begin(), il.end()) into a. Elements ofathat were not assigned to are destroyed | generally N log N, orNif [il.begin(), il.end()) is sorted according to value_comp() (whereNis il.size() + a.size()) | 
| a.key_comp() | X::key_compare | The comparison object with which awas constructed is returned. | constant | |
| a.value_comp() | X::value_compare | An object of type X::value_compare constructed out of the comparison object is returned. | constant | 
An AssociativeContainer X that is either std::map and std::multimap additionally supports the expression X::mapped_type, which has a return type of T, with the requirement that T be Destructible, and compile time complexity.
| This section is incomplete Reason: Finish requirements. | 
[edit] AssociativeContainers in the standard library
| collection of unique keys, sorted by keys (class template) | |
| collection of keys, sorted by keys (class template) | |
| collection of key-value pairs, sorted by keys, keys are unique (class template) | |
| collection of key-value pairs, sorted by keys (class template) |