int main() {
hash_multiset<const char*, hash<const char*>, eqstr> Set;
Set.insert('mango');
Set.insert('kiwi');
Set.insert('apple');
Set.insert('kiwi');
Set.insert('mango');
Set.insert('mango');
Set.insert('apricot');
Set.insert('banana');
Set.insert('mango');
lookup(Set, 'mango');
lookup(Set, 'apple');
lookup(Set, 'durian');
}
Defined in the header hash_set, and in the backward-compatibility header hash_set.h. This class is an SGI extension; it is not part of the C++ standard.
| Parameter | Description | Default |
|---|---|---|
Key | The hash_multiset's key type and value type. This is also defined as | |
HashFcn | The Hash Function used by the hash_multiset. This is also defined as | hash<Key> |
| EqualKey | The hash_multiset's key equality function: a binary predicate that determines whether two keys are equal. This is also defined as | equal_to<Key> |
Alloc | The | alloc |
Multiple Hashed Associative Container, Simple Associative Container
None.
| Member | Where defined | Description |
|---|---|---|
value_type | Container | The type of object, |
key_type | Associative Container | The key type associated with |
hasher | Hashed Associative Container | The |
key_equal | Hashed Associative Container | Function object that compares keys for equality. |
pointer | Container | Pointer to |
reference | Container | Reference to |
Вы читаете Standard Template Library Programmer's Guide
