set

set元素key不可重复。multiset可以重复。具体概念如下:

C++ STL 体系结构与内核分析(四)STL六大部件-关联式容器set/multiset/map.multimap

C++ STL 体系结构与内核分析(四)STL六大部件-关联式容器set/multiset/map.multimap

C++ STL 体系结构与内核分析(四)STL六大部件-关联式容器set/multiset/map.multimap

 

C++ STL 体系结构与内核分析(四)STL六大部件-关联式容器set/multiset/map.multimap

C++ STL 体系结构与内核分析(四)STL六大部件-关联式容器set/multiset/map.multimap

map

每个元素是key和value,无法改变key,能改data。

C++ STL 体系结构与内核分析(四)STL六大部件-关联式容器set/multiset/map.multimap

map结构源代码

C++ STL 体系结构与内核分析(四)STL六大部件-关联式容器set/multiset/map.multimap

map<int, string> imap;整数做key,string做data。

C++ STL 体系结构与内核分析(四)STL六大部件-关联式容器set/multiset/map.multimap

test

C++ STL 体系结构与内核分析(四)STL六大部件-关联式容器set/multiset/map.multimap

C++ STL 体系结构与内核分析(四)STL六大部件-关联式容器set/multiset/map.multimap

[]可以创建

test

C++ STL 体系结构与内核分析(四)STL六大部件-关联式容器set/multiset/map.multimap

 

相关文章:

  • 2022-12-23
  • 2021-10-21
  • 2021-05-21
  • 2021-06-01
  • 2022-12-23
  • 2021-07-31
  • 2022-01-21
  • 2021-06-18
猜你喜欢
  • 2021-05-04
  • 2021-10-08
  • 2021-07-22
  • 2022-01-01
  • 2021-07-07
  • 2021-05-07
  • 2021-10-03
相关资源
相似解决方案