Keys and Values
The properties of keys and values are listed below.
There are special rules for the key and the value of an ordered associative container.
The key has to be
- sortable (by default, they are sorted in ascending order)
- copyable and moveable
The value has to be
- default constructible
- copyable and moveable
The key associated with the value builds a pair p
so that we get a member with p.first
and the value with p.second
.
Get hands-on with 1400+ tech skills courses.