• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






HelloCsz

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

随笔分类 -  STL

 
effective STL
摘要:1.标准序列容器 vector/deque/list/string 2.标准关联容器 set/map/multise/multimap 3. 连续内存容器(contiguous-memory container) string/vector/deque 基于节点容器(node-based conta 阅读全文
posted @ 2017-08-31 21:22 HelloCsz 阅读(195) 评论(0) 推荐(0)
sort
摘要:#include #include #include "insertion_sort.h" int main() { int data[]={5,7,4,2,8,6,1,9,0,3}; //auto p= upper_bound(data,data+(sizeof(data)/ sizeof(int)),6); //std::cout ForwardIt ... 阅读全文
posted @ 2017-07-02 15:30 HelloCsz 阅读(262) 评论(0) 推荐(0)
Iterator invalidation(迭代器失效)
摘要:一.vector 所有读操作、swap、std::swap:都不会引起迭代器失效... clear、operator=、assign:都会引起全部变量迭代器失效 reserve、shrink_to_fit:如果capacity的大小被改变了,则引起全部变量迭代器失效 erase:被删除的变量以及其后 阅读全文
posted @ 2017-06-10 16:35 HelloCsz 阅读(490) 评论(0) 推荐(0)
shared_ptr注意点
摘要:1.原始指针不能直接使用赋值运算符对shared_ptr进行赋值运算 2.shared_ptr默认情况下不支持对数组内存的管理 in c++11,it is valid to construct a shared_ptr<T> from a std::unique_ptr<T[]>,since th 阅读全文
posted @ 2017-06-10 16:13 HelloCsz 阅读(184) 评论(0) 推荐(0)
std::forward_list
摘要:forward_list相比list来说空间利用率更好,与list一样不支持随机访问,若要访问除头尾节点的其他节点则时间复杂度为线性。 在forward_list成员函数里只能访问头节点以及向头节点插入与删除(front/push_front/emplace_front/pop_front)这些操作 阅读全文
posted @ 2017-05-27 17:22 HelloCsz 阅读(187) 评论(0) 推荐(0)