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');

}

Definition

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.

Template parameters
Parameter Description Default
Key The hash_multiset's key type and value type. This is also defined as hash_multiset::key_type and hash_multiset::value_type
HashFcn The Hash Function used by the hash_multiset. This is also defined as hash_multiset::hasher. 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 hash_multiset::key_equal. equal_to<Key>
Alloc The hash_multiset's allocator, used for all internal memory management. alloc
Model of

Multiple Hashed Associative Container, Simple Associative Container

Type requirements

• Key is assignable.

• EqualKey is a Binary Predicate whose argument type is Key.

• EqualKey is an equivalence relation.

• Alloc is an Allocator.

Public base classes

None.

Members
Member Where defined Description
value_type Container The type of object, T, stored in the hash_multiset.
key_type Associative Container The key type associated with value_type.
hasher Hashed Associative Container The hash_multiset's Hash Function.
key_equal Hashed Associative Container Function object that compares keys for equality.
pointer Container Pointer to T.
reference Container Reference to T
Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату