当前位置:网站首页>【STL源码剖析】STL六大组件功能与运用(目录)
【STL源码剖析】STL六大组件功能与运用(目录)
2022-06-24 22:40:00 【Cloudeeeee】
文章目录
【STL源码剖析】STL六大组件功能与运用(目录)
1. 容器(containers)
简介: 各种数据结构,用来存放数据,如vector、list、deque(双端队列)、set、map等等
2. 算法(algorithms)
简介: 各种STL提供的常用算法,如sort、search、copy、erase等等。从实现的角度来看,STL算法是一种方法模板(function template)
3. 迭代器(iterators)
简介: 迭代器扮演的是容器和算法之间的粘合剂,是所谓的“泛型指针”。从实现的角度来看,迭代器是一种将operator*,operator->,operator++,operator–,等指针相关操作重载的类模板(class template)。
所有STL容器都有自己专属的迭代器,原生指针(nativa pointer)也是一种迭代器。
什么是原生指针?
原生指针即普通的指针,类型名可以是基础类型,如int,double等,也可以是一个自己定义的Class类;但是如果一个类重载了 * 和 -> 的运算符,可以像指针一样用 * 和 -> 操作,就不是原生的。如iterator等。
4. 仿函数(functors)
简介: 仿函数的行为类似于函数,可以作为算法的某种策略。从实现的角度来看,仿函数是一种重载了operator()的class或class template。一般函数指针可视为狭义的仿函数。
5. 配接器(adapters、适配器)
简介: 配接器是一种用来修饰容器或仿函数或迭代器接口的东西,如STL提供的queue和stack,虽然看似容器,但是它们只能称作一种容器配接器,因为它们的底层借助的是deque来实现的。改变function接口的被称为function adapter,改变容器的被称为container adapter,改变iterator接口的被称为iterator adapter。
6. 配置器(allocator)
简介: 负责空间配置与管理。从实现的角度来看,配置器是一个实现了动态空间配置、空间释放的class template。

边栏推荐
- Left hand dreams right hand responsibilities GAC Honda not only pays attention to sales but also children's safety
- 02 common codes for Epicor secondary development
- Logminer database log mining
- Lizuofan, co-founder of nonconvex: Taking quantification as his lifelong career
- File system - basic knowledge of disk and detailed introduction to FAT32 file system
- Experience of epidemic prevention and control, home office and online teaching | community essay solicitation
- 年已过半,年终立的Flag实现了几个?
- [leetcode] 11. Container with the most water
- MOS管相关知识
- 左手梦想 右手责任 广汽本田不光关注销量 还有儿童安全
猜你喜欢

The role of software security testing, how to find a software security testing company to issue a report?

MeterSphere開源持續測試平臺與阿裏雲雲效DevOps的集成

常用的软件测试工具清单,请查收。

元宇宙的生态圈

Chinese address and English address

Left hand dreams right hand responsibilities GAC Honda not only pays attention to sales but also children's safety

DDD concept is complex and difficult to understand. How to design code implementation model in practice?

软件测试人员的7个等级,据说只有1%的人能做到级别7

Experience of epidemic prevention and control, home office and online teaching | community essay solicitation

入坑机器学习:一,绪论
随机推荐
【Proteus仿真】Arduino UNO+数码管显示4x4键盘矩阵按键
2022年云计算应用关键威胁调查
Intranet learning notes (5)
Redis
谈谈飞书对开发工作的优势 | 社区征文
MOS tube related knowledge
如何通过EasyCVR接口监测日志观察平台拉流情况?
write a number of lines to a new file in vim
Test / development programmers, 30, do you feel confused? And where to go
非凸联合创始人李佐凡:将量化作为自己的终身事业
創新藥二級市場審餅疲勞:三期臨床成功、產品獲批也不管用了
MOS管相关知识
O (log (min (m, n))
进入阿里做测试员遥不可及?这里或许有你想要的答案
Sumati gamefi ecological overview, element design in the magical world
1-6搭建Win7虚拟机环境
测试/开发程序员,30而立,你是否觉得迷茫?又当何去何从......
业务与技术双向结合构建银行数据安全管理体系
做软件安全测试的作用,如何寻找软件安全测试公司出具报告?
字符串数组转换为list集合