zhqherm

导航

2020年1月6日 #

STL源码笔记2 —— traits

摘要: STL源码笔记2 —— traits 简介 在stl的源码中,广泛用到了traits这个字样,用来表达一个萃取的方法的描述。traits在stl中的用途一般有几种,包括对应迭代器iterator的iterator traits,对应类类型的type traits,针对指针pointer的pointe 阅读全文

posted @ 2020-01-06 23:18 zhqherm 阅读(241) 评论(0) 推荐(0) 编辑

STL源码笔记1 —— allocators

摘要: STL源码笔记1 —— allocators 简述 allocators是STL中很重要的一个幕后英雄的角色,STL中的容器在使用过程中需要不断的放元素进去和取元素出来,而在此过程中,如何更高效的申请和释放内存是十分影响STL容器的性能的。 operator new() 和 malloc() 首先内 阅读全文

posted @ 2020-01-06 15:15 zhqherm 阅读(519) 评论(0) 推荐(0) 编辑