##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# C++ concepts: AssociativeContainer

From cppreference.com
< cpp‎ | concept

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 `X` when `X` supports unique keys
`a_eq` | Object in `X` when `X` supports multiple keys
`a_trans` | Object in `X` when type `X::key_compare::is_transparent` exists
`i`, `j` | `InputIterator`s denoting a valid range
`p` | const_iterator to `a`
`q` | dereferenceable const_iterator to `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 | effects | precondition | postcondition | complexity
--- | --- | --- | --- | --- | ---
X::key_type | `Key` |  |  |  | compile time

| This section is incomplete Reason: Finish requirements.

### [edit] AssociativeContainers in the standard library

set | collection of unique keys, sorted by keys (class template) [edit]
multiset | collection of keys, sorted by keys (class template) [edit]
map | collection of key-value pairs, sorted by keys, keys are unique (class template) [edit]
multimap | collection of key-value pairs, sorted by keys (class template) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/concept/AssociativeContainer&oldid=66099"
Category:

- Todo with reason