随笔分类 -  C++

摘要:STL六大组件 容器:各种数据结构,从实现的角度来看,STL容器是一种class template 空间配置器:负责动态空间的配置和管理 迭代器:在23个设计模式中,有一种是迭代器模式(提供一种方法,使之能够依序访问某个容器所含的各个元素,而无需暴露该容器的内部表述方式),其行为类似于智能指针;ST 阅读全文
posted @ 2022-03-03 10:35 DearLeslie 阅读(293) 评论(0) 推荐(0) 编辑
摘要:编译内存相关 C++ 程序编译过程 编译过程分为四个过程:编译(编译预处理、编译、优化),汇编,链接。 编译预处理:处理以 # 开头的指令; 编译、优化:将源码 .cpp 文件翻译成 .s 汇编代码; 汇编:将汇编代码 .s 翻译成机器指令 .o 文件; 链接:汇编程序生成的目标文件,即 .o 文件 阅读全文
posted @ 2022-02-24 11:29 DearLeslie 阅读(129) 评论(0) 推荐(0) 编辑
摘要:右值和左值引用成员函数 阅读全文
posted @ 2021-02-27 18:51 DearLeslie 阅读(360) 评论(0) 推荐(0) 编辑
摘要:右值引用对象移动 新标准的一个最主要的特性是可以移动而非拷贝对象的能力。很多情况下都会发生对象拷贝。在其中某些情况下,对象拷贝后就立即被销毁了。在这些情况下,移动而非拷贝对象会大幅度提升性能。 在重新分配内存的过程中,从旧内存将元素拷贝到新内存是不必要的,更好的方式是移动元素。使用移动而不是拷贝的另一个原因 阅读全文
posted @ 2021-02-26 15:31 DearLeslie 阅读(209) 评论(0) 推荐(0) 编辑
摘要:持续更新 阅读全文
posted @ 2021-02-24 12:59 DearLeslie 阅读(352) 评论(0) 推荐(0) 编辑
摘要:allocator用法 阅读全文
posted @ 2021-02-20 14:36 DearLeslie 阅读(163) 评论(0) 推荐(0) 编辑
摘要:shared_ptr 阅读全文
posted @ 2021-02-20 12:05 DearLeslie 阅读(156) 评论(0) 推荐(0) 编辑
摘要:constexpr构造函数 阅读全文
posted @ 2021-02-07 12:48 DearLeslie 阅读(338) 评论(0) 推荐(0) 编辑
摘要:类的隐式转换机制和explicit关键字 阅读全文
posted @ 2021-02-06 21:11 DearLeslie 阅读(450) 评论(0) 推荐(0) 编辑
摘要:委托别的构造函数 阅读全文
posted @ 2021-02-06 19:45 DearLeslie 阅读(337) 评论(0) 推荐(0) 编辑
摘要:private&public 阅读全文
posted @ 2021-02-06 13:49 DearLeslie 阅读(227) 评论(0) 推荐(0) 编辑
摘要:紧跟在参数列表后面的 const 表示this 是一个指向常量的指针 阅读全文
posted @ 2021-02-05 19:48 DearLeslie 阅读(100) 评论(0) 推荐(0) 编辑
摘要:指针也可以指向函数类型 阅读全文
posted @ 2021-02-05 15:49 DearLeslie 阅读(144) 评论(0) 推荐(0) 编辑
摘要:constexpr 阅读全文
posted @ 2021-02-05 13:47 DearLeslie 阅读(324) 评论(0) 推荐(0) 编辑
摘要:函数不能返回数组,但是可以返回数组指针 阅读全文
posted @ 2021-02-04 21:43 DearLeslie 阅读(933) 评论(0) 推荐(0) 编辑
摘要:initializer_list 阅读全文
posted @ 2021-02-03 20:32 DearLeslie 阅读(179) 评论(0) 推荐(0) 编辑
摘要:n++和++n 阅读全文
posted @ 2021-02-01 19:57 DearLeslie 阅读(712) 评论(0) 推荐(0) 编辑
摘要:find()、find_first_of()、find_first_not_of() 阅读全文
posted @ 2021-01-29 14:51 DearLeslie 阅读(1497) 评论(0) 推荐(0) 编辑
摘要:标准库bind函数 阅读全文
posted @ 2021-01-27 17:26 DearLeslie 阅读(449) 评论(0) 推荐(0) 编辑
摘要:函数真正的返回类型跟在形参列表之后 阅读全文
posted @ 2021-01-27 13:34 DearLeslie 阅读(554) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示