
C++
欢乐的企鹅
这个作者很懒,什么都没留下…
展开
-
stl_vector::insert_aux方法原理
stl_vector::insert_aux源码 template <class T, class Alloc> void vector<T, Alloc>::insert_aux(iterator position, const T& x) { if (finish != end_of_storage) {//如果还有备用空间 construct(finish, *(finish - 1));//在备用空间开头构造一个对象,以最后一个元素为对象内容原创 2021-04-04 15:15:10 · 659 阅读 · 0 评论 -
STL容器元素打印函数print_elems(方便调试)
#ifndef HELPER_INFO_H #define HELPER_INFO_H //辅助宏 #define __endline cout << endl; #define __fname__ cout << endl << endl << "========= " << __PRETTY_FUNCTION__<< " ==========" << endl; #include <iostream>.原创 2021-04-04 17:45:46 · 382 阅读 · 0 评论