STL_summary

http://www.cplusplus.com/reference/

--------
priority_queue<int, vector<int>, less<int> > ip(a,a+10);
typedef priority_queue<int, vector<int> less<int> >::iterator IT;


set<int> is;
is.begin() is.end()
is.count(data) 
#-->check data is in the set list
is.empty() size()
is.erase(iterator) 
is.erase(iterator,is.end()) 
is.erase(value)
it=is.find(20);
is.erase(is.find(20));
#set has lower_bound upper_bound
lower=is.lower_bound(20);
upper=is.upper_bound(50);
#we could find 20 -- 50 elements


multiset<int> ms;
range=ms.equal_range(3);
ms.erase(range.first,range.second)


map<string,string> mapinfo;
mapinfo.insert(map<string,string>::value_type("1","hello"))
mapinfo.insert(make_pair("1","hello"));
lower=mapinfo.lower_bound("1");
upper=mapinfo.upper_bound("1");
map<string,string>::size_type cnt=mapinfo.count("1");
it=mampinfo.find("1"); 
#while(cnt--) cout<<*it++<<endl;
--------------




1. list 
front()/back()
begin()/end()
push_back()/pop_back()
push_front()/pop_front()
erase()/remove()
insert()
size()/empty()
sort()/unique()




2. queue
push()/pop()
front()/back()
size()/empty()




3. priority_queue
push()/pop()
top()
size()/empty()




4. deque
begin/end
front/back
size/empty/clear
push_back/pop_back
push_front/pop_front
insert/erase
operator[]


5. stack
push/pop
size/empty
top


6. array
size/empty
begin/end
front/back
data/operator[]
fill


7.vector
begin/end
front/back
size/empty/clear
insert/erase
push_back/pop_back
operator[]




8. map
begin/end
operator[]
size/empty
insert/erase/clear
find


9. multimap
begin/end
size/empty
insert/erase/clear
find/count/lower_bound/upper_bound/equal_range


10. set
begin/end
size/empty
insert/erase/clear
find


11. multiset
begin/end
size/empty/clear
insert/erase
find/count/lower_bound/upper_bound/equal_range
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值