C.Plus.Plus.Primer.4th.Edition [Electronic resources]

نسخه متنی -صفحه : 199/ 117
نمايش فراداده

Defined Terms

associative array

Array whose elements are indexed by key rather than positionally. We say that the array maps a key to its associated value.

associative container

A type that holds a collection of objects that supports efficient lookup by key.

key_type

Type defined by the associative containers that is the type for the keys used to store and retrieve values. For a map, key_type is the type used to index the map. For set, key_type and value_type are the same.

map

Associative container type that defines an associative array. Like vector, map is a class template. A map, however, is defined with two types: the type of the key and the type of the associated value. In a map a given key may appear only once. Each key is associated with a particular value. Dereferencing a map iterator yields a pair that holds a const key and its associated value.

mapped_type

Type defined by map and multimap that is the type for the values stored in the map.

multimap

Associative container similar to map except that in a multimap, a given key may appear more than once.

multiset

Associative container type that holds keys. In a multiset, a givenkey may appear more than once.

pair

Type that holds two public data members named first and second. The pair type is a template type that takes two type parameters that are used as the types of these members.

set

Associative container that holds keys. In a set, a given key may appear only once.

strict weak ordering

Section 10.3.1 (p. 360).

value_type

The type of the element stored in a container. For set and multiset, value_type and key_type are the same. For map and multimap, this type is a pair whose first member has type const key_type and whose second member has type mapped_type.

* operator

The dereference operator when applied to a map, set, multimap, or multiset iterator yields a value_type. Note, that for map and multimap the value_type is a pair.

[] operator

Subscript operator. When applied to a map, [] takes an index that must be a key_type (or type that can be converted to key_type) value. Yields a mapped_type value.