集合 使用set或multiset之前,必须加入头文件<set> Set.multiset都是集合类,差别在与set中不允许有重复元素,multiset中允许有重复元素. sets和multiset内部以平衡二叉树实现 1. 常用函数 1) 构造函数和析构函数 set c:创建空集合,不包含任何元素 set c(op):以op为排序准则,产生一个空的set set c1(c2):复制c2中的元素到c1中 set c(const value_type *first, const…
I decide to write to my blogs in English. When I meet something hard to depict, I'll add some Chinese necessarily. The differences between these containers are : The keys of set and map are unique, but they could be multiple for multiset and multimap…
set: Sets are containers that store unique elements following a specific order.集合里面的元素不能修改,只能访问,插入或者删除.内部由二叉搜索树来实现(binary search trees):默认排序为:数字从小到大的顺序,可通过传入函数指针或者函数对象来修改排序规则. multiset: 和 set 操作一样,不同点是 key 可以相同. Iterators begin: end: rbegin: rend: c…