Name | Expression | Precondition | Semantics | Postcondition |
---|---|---|---|---|
Range constructor | X(i, j) X a(i, j); | Creates an associative container that contains all elements in the range | ||
Range constructor with bucket count | X(i, j, n) X a(i, j, n); | Creates an associative container that contains all elements in the range | ||
Range constructor with hash function | X(i, j, n, h) X a(i, j, n, h); | Creates an associative container that contains all elements in the range | The bucket count is greater than or equal to | |
Range constructor with key equal | X(i, j, n, h, k) X a(i, j, n, h, k); | Creates an associative container that contains all elements in the range |
The range constructor, range constructor with bucket count, range constructor with hash function, and range constructor with key equal, are all linear in
• hash_multiset
• hash_multimap
[1] At present (early 1998), not all compilers support 'member templates'. If your compiler supports member templates then
Associative Container, Hashed Associative Container, Unique Hashed Associative Container, Sorted Associative Container
Container classes
Sequences
vector<T, Alloc>
Category: containers
Component type: type
A
vector<int> V;
V.insert(V.begin(), 3);
assert(V.size() == 1 && V.capacity() >= 1 && V[0] == 3);