SyntaxC++ Copy template < class Key, class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Alloc = std::allocator<Key>> class unordered_set; ParametersKey The key type.Hash The hash function object type.Pred The equality comparison function object type.Alloc The ...
In dit artikel Syntax Members Remarks unordered_set::allocator_type Nog 43 weergeven The class template describes an object that controls a varying-length sequence of elements of type const Key. The sequence is weakly ordered by a hash function, which partitions the sequence into an ...
SyntaxC++ Copy template < class Key, class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Alloc = std::allocator<Key>> class unordered_set; ParametersKey The key type.Hash The hash function object type.Pred The equality comparison function object type.Alloc The ...
Syntax const_iterator find(const Key& keyval) const; Parameters keyval Key value to search for. Remarks The member function returnsunordered_set::equal_range(keyval).first. Example // std_tr1__unordered_set__unordered_set_find.cpp // compile with: /EHsc #include <unordered_set> #include <...
你会得到一个编译错误,因为你试图传递一个Hasher类型的对象(即实例)作为模板参数。
Syntax C++Копирај template<typenameK,typenameV,typenameC =std::equal_to<K> > ref class Map sealed; Parameters K The type of the key in the key-value pair. V The type of the value in the key-value pair. C A type that provides a function object that can compare two elemen...
SyntaxC++ Copy template <class Key, class Ty, class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Alloc = std::allocator<Key>> class unordered_multimap; ParametersKey The key type.Ty The mapped type.Hash The hash function object type....
SyntaxC++ Copy template <class Key, class Ty, class Hash = std::hash<Key>, class Pred = std::equal_to<Key>, class Alloc = std::allocator<Key>> class unordered_multimap; ParametersKey The key type.Ty The mapped type.Hash The hash function object type....
Syntax Members Remarks Requirements Show 48 more The class template describes an object that controls a varying-length sequence of elements of type std::pair<const Key, Ty>. The sequence is weakly ordered by a hash function, which partitions the sequence into an ordered set of subsequenc...
All containers can be iterated in the same manner, and all use the same element access syntax. E.g.: c_foreach (it, MyInts, myints) *it.ref += 42; works for any container defined as MyInts with int elements. c_foreach (it, MyInts, it1, it2) *it.ref += 42; iterate...