STL学习----入门(1)[unordered_set]

#include<unordered_set>:

C++11

   
   
  1. // <unordered_set>
  2. template < class Key,
  3. class Hash = hash<Key>,
  4. class Pred = equal_to<Key>,
  5. class Alloc = allocator<Key>
  6. > class unordered_set;

无序集合(Unordered Set)容器是一个存储唯一(Unique,即无重复)元素的关联容器(Associative container),容器中的元素无特别的次序关系。该容器允许基于值地快速元素检索。

An unordered_set is an unordered associative container that supports unique keys (an unordered_set contains at most one of each key value) and in which the elements’ keys are the elements themselves.

容器特性:

关联(Associative)

关联容器中的元素是通过主键(Key)而不是它们在容器中的绝对位置来引用的。

无序(Unordered)

无序容器通过 hash 表来组织它们的元素,允许通过主键快速地访问元素。

集合(Set)

元素的值同时可以用来标志对应的元素。

键唯一(Unique keys)

容器中不存在两个元素有相同的主键。

能够感知内存分配器的(Allocator-aware)

容器使用一个内存分配器对象来动态地处理它的存储需求。


  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值