📄 cppmultiset_details.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <meta name="generator" content="HTML Tidy for Linux/x86 (vers 1st October 2002), see www.w3.org"> <title>C++ Multisets</title> </head> <body bgcolor="#ffffff"> <table width="100%" bgcolor="#eeeeff"> <tr> <td><a href="index.html">cppreference.com</a> -> <a href="cppmultiset.html">C++ Multisets</a> -> Details</td> </tr> </table> <h1>C++ Multisets</h1> <hr> <h2><a name="begin">begin</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> <a href="iterators.html">iterator</a> begin();</pre> </td> </tr> </table> <p>The function begin() returns an <a href="iterators.html">iterator</a> to the first element in the multiset.</p> <hr> <h2><a name="clear">clear</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> void clear();</pre> </td> </tr> </table> <p>The clear() function deletes all elements from the multiset.</p> <hr> <h2><a name="count">count</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> size_type count( const key_type &key );</pre> </td> </tr> </table> <p>The function count() returns the number of occurrences of <i>key</i> in the multiset.</p> <hr> <h2><a name="empty">empty</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> bool empty();</pre> </td> </tr> </table> <p>The function empty() returns <strong>true</strong> if the multiset is empty, and <strong>false</strong> otherwise.</p> <hr> <h2><a name="end">end</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> <a href="iterators.html">iterator</a> end();</pre> </td> </tr> </table> <p>The end() function returns an <a href="iterators.html">iterator</a> to the end of the multiset.</p> <hr> <h2><a name="equal_range">equal_range</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> pair<iterator, iterator> equal_range( const key_type &key );</pre> </td> </tr> </table> <p>The function equal_range() returns two iterators - one to the first element that contains <i>key</i>, another to the last element that contains <i>key</i>.</p> <hr> <h2><a name="erase">erase</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> void erase( <a href="iterators.html">iterator</a> pos ); void erase( <a href="iterators.html">iterator</a> start, <a href="iterators.html">iterator</a> end ); size_type erase( const key_type &key );</pre> </td> </tr> </table> <p>The erase function() either erases the element at <i>pos</i>, erases the elements between <i>start</i> and <i>end</i>, or erases all elements that have the value of <i>key</i>.</p> <hr> <h2><a name="find">find</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> <a href="iterators.html">iterator</a> find( const key_type &key );</pre> </td> </tr> </table> <p>The find() function returns an <a href="iterators.html">iterator</a> to <i>key</i>, or an <a href= "iterators.html">iterator</a> to the end of the multiset if <i>key</i> is not found.</p> <hr> <h2><a name="get_allocator">get_allocator</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> allocator_type get_allocator();</pre> </td> </tr> </table> <p>The get_allocator() function returns the allocator of the multiset.</p> <hr> <h2><a name="insert">insert</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> <a href="iterators.html">iterator</a> insert( <a href="iterators.html">iterator</a> pos, const <a href="containers.html">TYPE</a> &val ); void insert( <a href="iterators.html">input_iterator</a> start, <a href="iterators.html">input_iterator</a> end ); pair<iterator, bool> insert( const <a href="containers.html">TYPE</a> &val );</pre> </td> </tr> </table> <p>The function insert() either:</p> <ul> <li>inserts <i>val</i> after the element at <i>pos</i>, and returns an <a href= "iterators.html">iterator</a> to that element.</li> <li>inserts a range of elements from <i>start</i> to <i>end</i>.</li> <li>inserts <i>val</i>, but only if <i>val</i> doesn't already exist. The return value is an <a href= "iterators.html">iterator</a> to the element inserted, and a boolean describing whether an insertion took place.</li> </ul> <br> <br> <hr> <h2><a name="key_comp">key_comp</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> key_compare key_comp();</pre> </td> </tr> </table> <p>The function key_comp() returns the function that compares keys.</p> <hr> <h2><a name="lower_bound">lower_bound</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> <a href="iterators.html">iterator</a> lower_bound( const key_type &key );</pre> </td> </tr> </table> <p>The lower_bound() function returns an <a href="iterators.html">iterator</a> to the first element which has a value greater than or equal to <i>key</i>.</p> <hr> <h2><a name="max_size">max_size</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> size_type max_size();</pre> </td> </tr> </table> <p>The function max_size() returns the maximum number of elements that the multiset can hold.</p> <hr> <h2><a name="rbegin">rbegin</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> <a href="iterators.html">reverse_iterator</a> rbegin();</pre> </td> </tr> </table> <p>The rbegin() function returns a reverse <a href="iterators.html">iterator</a> to the end of the multiset.</p> <hr> <h2><a name="rend">rend</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> <a href="iterators.html">reverse_iterator</a> rend();</pre> </td> </tr> </table> <p>The function rend() returns a reverse <a href="iterators.html">iterator</a> to the start of the multiset.</p> <hr> <h2><a name="size">size</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> size_type size();</pre> </td> </tr> </table> <p>The function size() returns the number of elements currently in the multiset.</p> <hr> <h2><a name="swap">swap</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> void swap( multiset<Key,Comp,Allocator> &obj );</pre> </td> </tr> </table> <p>The swap() function exchanges the elements in <i>obj</i> with those in the current multiset.</p> <hr> <h2><a name="upper_bound">upper_bound</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> <a href="iterators.html">iterator</a> upper_bound( const key_type &key );</pre> </td> </tr> </table> <p>The function upper_bound() returns an <a href="iterators.html">iterator</a> to the first element in the multiset with a key greater than <i>key</i>.</p> <hr> <h2><a name="value_comp">value_comp</a></h2> <i>Syntax:</i> <table bgcolor="#ccccff"> <tr> <td><pre> value_compare value_comp();</pre> </td> </tr> </table> <p>The value_comp() function returns the function that compares values.</p> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -