当前位置 博文首页 > duchenlong的博客:C++模拟实现常用的STL中string类
duchenlong的博客:C++模拟实现常用的STL中string类
作者:[db:作者]
时间:2021-08-19 15:44
string 类的实现
- 成员变量
- 默认成员函数
-
- 运算符重载
- 赋值运算符
- [ ]运算符重载
- += 运算符重载
- cout运算符重载
- cin运算符重载
- getline 获取一行数据
- 比较运算符重载
- Modifiers修饰符
- push_back 尾插
- append追加
- insert 插入
- erase 消除
- capacity 容量
- size 返回字符串大小
- capacity 返回字符串容量
- reserve 增加容量
- resize 固定容量
- clear 清理函数
- empty 判空
- Iterators 迭代器
-
- String operations
-
cs