-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
3,173 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
STL学习思想: | ||
|
||
1、**模版:一定要注意参数和返回值的模版;** | ||
|
||
2、**STL一系列的API:一定要注意返回值;** | ||
|
||
3、**容器中的都是值拷贝,而不是引用,在执行插入时,内部实行拷贝动作,所以STL中插入类时,一般都必须:无参构造函数,拷贝构造函数,重载=运算符,必须的自己重写,达到深拷贝!!!** | ||
|
||
4、**一元谓词:函数只有一个参数,谓词:代表函数的返回值必须为bool类型;二元谓词:函数只有二个参数,谓词:代表函数的返回值必须为bool类型;** | ||
|
||
5、**算法和具体的数据类型相分离:通过函数对象(仿函数)来实现,本质:函数指针!!!** | ||
|
||
6、**容器和具体的数据类型相分离,通过模板技术实现的;** | ||
|
||
7、**一个容器都有其对应的迭代器进行访问;** | ||
|
||
8、**所有的容器都是通过空间配置器来分配空间的;** | ||
|
||
9、**函数适配器有一元的、二元的,就是函数参数的绑定;** | ||
|
||
原文链接:[C++进阶系列之STL(7)---STL学习思想](https://mp.weixin.qq.com/s?__biz=MzUxMzkyNDk0Ng==&mid=2247484011&idx=1&sn=f08da663d2707c7bcf387804bb0b8918&chksm=f94c8856ce3b01403abf9fbcadeba83d81f20018f864125ad6ddbb7b60a55e29185a3316c360&scene=21#wechat_redirect) |
Oops, something went wrong.