set 和,multiset, map和multimap 技术编程详解

set ,multiset, mapmultimap 技术编程详解

1

    //bool empty() const;

    //判断集合是否为空

2

    //begin, end

    //const_iterator    begin() const;

    //iterator              begin();

    //const_iterator    end() const;

    //iterator              end();

    //前向迭代器

3

    //rbegin,rend

    //const_reverse_iterator    rbegin() const;

    //reverse_iterator              rbegin();

    //const_reverse_iterator    rend() const;

    //reverse_iterator              rend();

    //反向迭代器

4

    //insert

    //pair<iterator, bool>  insert(const value_type& _Val);

    //iterator                   insert(iterator _Where, const value_type& _Val);

    //template<typename InputIterator>

    //void                       insert(InputIterator _First, InputIterator _Last);

    //插入一个对象,一个对象的若干拷贝,或者一个范围以内的对象

5

    //count

    //size_type count(const Key& _Key) const;

    //返回元素在setmultiset中出现的次数

6

    //find

    //iterator              find(const Key& _Key) const;

    //const_iterator    find(const Key& _Key) const;

    //返回指向_Key的迭代器

7

    //max_size

    //size_type max_size() const;

    //返回可以容纳的最大元素个数

8

    //size

    //size_type size() const;

    //返回集合大小,即集合中元素的个数

9

    //get_allocator

    //Allocator get_allocator() const;

    //读取内存分配器,但不能改变

10

    //key_compare

    //key_compare key_comp() const;

    //键值比较,默认按照less顺序进行排序,可设置按greater排序

11

    //value_comp

    //value_compare value_comp() const;

    //实值比较,默认按照less顺序进行排序,可设置按greater排序

12

    //upper_bound

    //const_iterator    upper_bound(const Key& _Key) const;

    //iterator              upper_bound(const Key& _Key) const;

    //返回指向大于_Key元素的迭代器

13

    //lower_bound

    //const_iterator    lower_bound(const Key& _Key) const;

    //iterator              lower_bound(const Key& _Key) const;

    //返回指向小于_Key元素的迭代器

14

    //equal_range

    //pair<const_iterator, const_iterator> equal_range(const Key& _Key) const;

    //pair<iterator, iterator>                    equal_range(const Key& _Key) const;

    //返回代表集合或者多集合元素中上下限的两个迭代器

15

    //erase

    //iterator     erase(iterator _Where);

    //iterator     erase(iterator _First, iterator _Last);

    //size_type erase(const key_type& _Key);

    //删除由一个iterator指出的元素,也可以删除一个范围的元素

16

    //clear

    //void clear();

    //清空容器

17

    //swap

    //void swap(set& _Right)

    //void swap(multiset& _Right)

    //void swap(map& _Right)

    //void swap(multimap& _Right)

    //两个容器的内容进行交换

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值