智慧的老鸟

一个程序员需要有一棵Gank的心,Dota能培养我。

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2012年10月30日

摘要: 问题:set是一个自动有序的集合容器,这是set的一个最实惠的性质,从小到大,只要你插入进去,就有序了。但是,如果你不想要这个顺序呢,是不是可以人为控制set容器的元素顺序呢?答案是,可以的,因为stl也是程序员设计的。首先看stl的模板构造函数explicit set ( const Compare& comp = Compare(), const Allocator& = Allocator() );templateset ( InputIterator first, InputIterator last, const Compare& comp = Compare 阅读全文
posted @ 2012-10-30 08:14 智慧的老鸟 阅读(1275) 评论(0) 推荐(0)