![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
STL容器
文章平均质量分 76
uniquever
这个作者很懒,什么都没留下…
展开
-
简单的vector实现
学习c++中,看完书后,最近苦于不知道下一步该怎么办了,就翻翻STL源码剖析中的各种容器,想重新实现一遍。很多问题之前看的时候还不知道是怎么回事,当自己写的时候才发现许多应该注意与理解的。这个vector类写得特别简单,只实现了其中的一部分功能,因为没有使用iterator,发现一些函数不太好写,而且封装性极差,同时,只能存放内置类型。在这些问题中,希望自己以后会好好重写一下。 这个程序有点小情原创 2014-11-01 16:40:32 · 1379 阅读 · 0 评论 -
简单内存池实现
#include #include #include #include using namespace std; class MemPool{ struct FreeNode{ struct FreeNode* next; }; private: static const int allocNum = 8; static const int step = 4; stati原创 2015-04-02 23:55:42 · 692 阅读 · 0 评论