list vector deque stack queue priority_queue

set

[unordered_set]

map

[unordered_map]

multimap

[unordered_multimap]

    contiguous storage double-ended queue LIFO FIFO 1st is greatest      
Iterators       X X X      
Element access push_back push_back push_back push push push      
push_front   push_front            
pop_back pop_back pop_back pop pop pop      
pop_front   pop_front            
front front front top front top      
back back back   back        
  at(i) at(i)         at(key)  
Modifiers assign assign assign            
insert insert insert      

insert

emplace

insert

emplace(key,val)

 insert

emplace(key,val)

erase erase erase       erase

erase(key)=>erasednum

erase(it/ita,itb)=>it

erase(key)=>int(多个)

erase(it/ita,itb)=>it

swap swap swap       swap swap(mapb) swap(mapb)
clear clear clear       clear clear()  clear()
Capacity resize resize resize            
empty empty empty empty empty empty empty empty()  empty()
Operations splice           find find(key)=>it  find(key)=>it(单个)
remove           count count(key)  count(key)
remove_if           equal_range equal_range  equal_range(pair)
unique           upper_bound upper_bound  upper_bound
merge           lower_bound lower_bound  lower_bound
sort                
  reverse                

List Operations

list splice // it points to 2 | mylist1: 1 2 3 4 |mylist2: 10 20 30
mylist1.splice (it, mylist2);
// mylist1: 1 10 20 30 2 3 4 | mylist2 (empty)|"it" still points to 2
mylist2.splice (mylist2.begin(),mylist1, it);
// mylist1: 1 10 20 30 3 4 | mylist2: 2 | "it" is now invalid.
mylist1.splice ( mylist1.begin(), mylist1, it, mylist1.end());
//"it" points now to 30 | mylist1: 30 3 4 1 10 20
remove mylist.remove (value); 
remove_if mylist.remove_if (function);
mylist.remove_if(class());
unique bool same_integral_part (double first, double second)
{ return ( int(first)==int(second) ); }
mylist.sort();             //  2.72,  3.14, 12.15, 12.77, 12.77,
                             // 15.3,  72.25, 72.25, 73.0,  73.35
mylist.unique();           //  2.72,  3.14, 12.15, 12.77
                             // 15.3,  72.25, 73.0,  73.35
mylist.unique (same_integral_part);  //  2.72,  3.14, 12.15
                                       // 15.3,  72.25, 73.0
merge first.sort();
second.sort();
first.merge();
first.merge(second,mycomparison);
sort  
reverse  

STL容器用法速查表:list,vector,stack,queue,deque,priority_queue,set,map的更多相关文章

  1. java三篇博客转载 详解-vector,stack,queue,deque

    博客一:转载自http://shmilyaw-hotmail-com.iteye.com/blog/1825171 java stack的详细实现分析 简介 我们最常用的数据结构之一大概就是stack ...

  2. HTML5速查表

    HTML5速查表 标签 描述 版本 属性 <!--...--> 定义注释 4 / 5 none <!DOCTYPE> 定义文档类型 4 / 5 none <a> 定 ...

  3. OpenStack 命令行速查表

    OpenStack 命令行速查表   updated: 2017-07-18 08:53 Contents 认证 (keystone) 镜像(glance) 计算 (nova) 实例的暂停.挂起.停止 ...

  4. GNU Emacs命令速查表

    GNU Emacs命令速查表 第一章  Emacs的基本概念 表1-1:Emacs编辑器的主模式 模式 功能 基本模式(fundamental mode) 默认模式,无特殊行为 文本模式(text m ...

  5. 机器学习速查表(cheatsheet)资源汇总分享

    本文收集整理了机器学习相关速查表(Machine Learning Cheatsheet),包含机器学习.Python.Numpy.Pandas.Matplotlib.线性代数.微积分.统计学.概率论 ...

  6. 简明 Git 命令速查表(中文版)

    原文引用地址:https://github.com/flyhigher139/Git-Cheat-Sheet/blob/master/Git%20Cheat%20Sheet-Zh.md在Github上 ...

  7. .htaccess下Flags速查表

    Flags是可选参数,当有多个标志同时出现时,彼此间以逗号分隔. 速查表: RewirteRule 标记 含义 描述 R Redirect 发出一个HTTP重定向 F Forbidden 禁止对URL ...

  8. Markdown 语法速查表

      Markdown 语法速查表 1 标题与文字格式 标题 # 这是 H1 <一级标题> ## 这是 H2 <二级标题> ###### 这是 H6 <六级标题> 文 ...

  9. jQuery API 3.1.0 速查表-打印版

    jQuery API 3.1.0 速查表-打印图,(API来自:http://jquery.cuishifeng.cn/index.html)

随机推荐

  1. Xmanager如何连接图形化界面

    1.编辑gnome配置文件vim /etc/gdm/custom.conf # GDM configuration storage [daemon]RemoteGreeter= /usr/libexe ...

  2. spring mvc读取url变量

    @RequestMapping(value="/{id}/{name}", method=RequestMethod.GET) public ModelAndView getUrl ...

  3. 使用drawBitmapMesh扭曲图像

    Canvas提供了一个drawBitmapMesh(bitmap, meshWidth, meshHeight, verts, vertOffset, colors, colorOffset, pai ...

  4. Linux 常用命令杂记

    移动光标:h:向左移动j:向下移动k:向上移动l:向上移动 与window 光标移动键功能一致. 常用命令行:shift + ^ 行首shift + $ 行尾ctrl + v 可视模式 , 选择一个范 ...

  5. 倍增 LCA

    以NOIP2013提高组day1 最后一道题为例来学的倍增和lca.其实这套题早就做过了,倍增和lca也学过,只不过当时没有理解清楚,所以今天再次学了一遍,虽然没有时间编程序了,但是先把思路和做法在这 ...

  6. 改变Chrome浏览器主程序_缓存_个人信息路径

      改变Chrome浏览器缓存_个人信息路径(亲测) actionx2上传于2012-10-26|(7人评价)|3077人阅读|41次下载|文档简介|举报文档    在手机打开   改变 Chrom ...

  7. BT3入门之中文语言支持

    汉化: 1.更新软件库:apt-get update 2.安装中文语言包:apt-get install language-support-zh   apt-get install language- ...

  8. ie浏览器兼容性快速处理小招

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  9. Project和Module的介绍

    Project 和 Module 介绍 这两个概念是 IntelliJ IDEA 的必懂知识点之一,请务必要学会. 如果你是 Eclipse 用户,并且已经看了上面给的链接,那 IntelliJ ID ...

  10. Canopy使用教程 (3)

    1. 2. plot函数: plot默认生成是曲线图,可以通过kind参数生成其他的图形,可选的值为:line, bar, barh, kde, density, scatter. 散点图.使用kin ...