Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
puge-up committed Jul 25, 2021
1 parent c6670fb commit 0c4ef43
Show file tree
Hide file tree
Showing 10 changed files with 3,173 additions and 0 deletions.
623 changes: 623 additions & 0 deletions article/C++_STL/C++进阶系列之STL_SGI版本空间配置器.md

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions article/C++_STL/C++进阶系列之STL_STL学习思想.md
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)
Loading

0 comments on commit 0c4ef43

Please sign in to comment.