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 <),
  • copyable and moveable.

The value has to be

  • default constructible,
  • copyable and moveable.

The key associated with the value builds a pair p. The key and value can then be retrieved by p.first and p.second, respectively.

Get hands-on with 1000+ tech skills courses.