hash_map::hash_map

备注

此 API 已过时。替代为 unordered_map 类

构造为空或是其他某些 hash_map 全部或部分的副本的 hash_map。

hash_map( );
explicit hash_map(
    const Traits& Comp
);
hash_map(
    const Traits& Comp,
    const Allocator& Al
);
hash_map(
    const hash_map& Right
);
hash_map(
    hash_map&& Right
);
hash_map(
     initializer_list<Type> IList
);
hash_map(
     initializer_list<Type> IList,
     const key_compare& Comp
);
hash_map(
     initializer_list<Type> IList,
     const key_compare& Comp, 
     const allocator_type& Al
);
template<class InputIterator>
   hash_map(
      InputIterator First,
      InputIterator Last
   );
template<class InputIterator>
   hash_map(
      InputIterator First,
      InputIterator Last,
      const Traits& Comp
   );
template<class InputIterator>
   hash_map(
      InputIterator First,
      InputIterator Last,
      const Traits& Comp,
      const Allocator& Al

参数

参数

说明

Al

此存储分配程序类将使用默认遵守 Allocator的哈希映射对象。

Comp

比较函数的静态类型 Traits Traits 用来对映射中的元素进行排序, 默认为 hash_compareTraits.

Right

构造为映射的哈希映射为一个副本。

First

要复制的元素范围中的第一个元素的位置。

Last

要复制的元素范围之外的第一个元素的位置。

IList

The initializer_list

备注

所有构造函数存储了一个为映射管理内存存储的分配器对象的类型并且此对象能够通过调用get_allocator返回。 分配器参数通常在所使用的类声明和用于替换分配器的预处理器宏被忽略。

所有构造函数初始化它们的哈希映射。

所有的构造函数存储了一个用来在哈希映射的关键值中建立排序的函数对象类型 Traits ,并且接下来可以通过调用 key_comp.

初始的三个构造函数指定了空的初始哈希映射, 另外,第二个构造函数则指定了用来建立元素次序的比较函数(Comp)的类型,第三个构造函数则明确指定了使用的分配器类型 (Al) 。 关键字explicit抑制了一些种类的自动类型转换。

第四个构造函数指定了哈希映射Right 的副本。

接下来的最后三个构造函数复制了在类Traits和分配器的比较函数类型中明显增长的哈希映射范围 [First, Last) 。

最后一个构造函数将哈希映射移动到 Right。

要求

标头: <hash_map>

**命名空间:**stdext

请参见

参考

hash_map 类

标准模板库