📄 all.html
字号:
Syntax: </div> <pre class="syntax-box"> #include <set> iterator find( const <a href="../containers.html">key_type</a>& key );</pre> <p>The find() function returns an iterator to <em>key</em>, or an iterator to the end of the multiset if <em>key</em> is not found.</p> <p>find() runs in <a href="../complexity.html">logarithmic time</a>.</p> </div> </td> </tr> </table></body></html><hr> <div class="name-format"> insert </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <set> iterator insert( iterator pos, const <a href="../containers.html">TYPE</a>& val ); iterator insert( 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 );</pre> <p>The function insert() either:</p> <ul> <li>inserts <em>val</em> after the element at <em>pos</em> (where <em>pos</em> is really just a suggestion as to where <em>val</em> should go, since multisets and multimaps are ordered), and returns an iterator to that element.</li> <li>inserts <em>val</em> into the multiset, returning an iterator to the element inserted.</li> <li>inserts a range of elements from <em>start</em> to <em>end</em>.</li> </ul> </div> </td> </tr> </table></body></html><hr> <div class="name-format"> key_comp </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <set> key_compare key_comp() const;</pre> <p>The function key_comp() returns the function that compares keys.</p> <p>key_comp() runs in <a href="../complexity.html">constant time</a>.</p> <div class="related-name-format"> Related topics: </div> <div class="related-content"> <a href="value_comp.html">value_comp</a> </div> </div> </td> </tr> </table></body></html><hr> <div class="name-format"> lower_bound </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <set> iterator lower_bound( const <a href="../containers.html">key_type</a>& key );</pre> <p>The lower_bound() function returns an iterator to the first element which has a value greater than or equal to key.</p> <p>lower_bound() runs in <a href="../complexity.html">logarithmic time</a>.</p> <div class="related-name-format"> Related topics: </div> <div class="related-content"> <a href="upper_bound.html">upper_bound</a> </div> </div> </td> </tr> </table></body></html><hr> <div class="name-format"> max_size </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <set> <strong>size_type</strong> max_size() const;</pre> <p>The max_size() function returns the maximum number of elements that the multiset can hold. The max_size() function should not be confused with the <a href="size.html">size</a>() or (C++ Strings) <a href="../cppstring/capacity.html">capacity</a>() functions, which return the number of elements currently in the multiset and the the number of elements that the multiset will be able to hold before more memory will have to be allocated, respectively.</p> <div class="related-name-format"> Related topics: </div> <div class="related-content"> <a href="size.html">size</a> </div> </div> </td> </tr> </table></body></html><hr> <div class="name-format"> rbegin </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <set> <a href="../iterators.html">reverse_iterator</a> rbegin(); const_<a href="../iterators.html">reverse_iterator</a> rbegin() const;</pre> <p>The rbegin() function returns a <a href= "../iterators.html">reverse_iterator</a> to the end of the current multiset.</p> <p>rbegin() runs in <a href="../complexity.html">constant time</a>.</p> <div class="related-name-format"> Related topics: </div> <div class="related-content"> <a href="begin.html">begin</a><br> <a href="end.html">end</a><br> <a href="rend.html">rend</a> </div> </div> </td> </tr> </table></body></html><hr> <div class="name-format"> rend </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <set> <a href="../iterators.html">reverse_iterator</a> rend(); const_<a href="../iterators.html">reverse_iterator</a> rend() const;</pre> <p>The function rend() returns a <a href= "../iterators.html">reverse_iterator</a> to the beginning of the current multiset.</p> <p>rend() runs in <a href="../complexity.html">constant time</a>.</p> <div class="related-name-format"> Related topics: </div> <div class="related-content"> <a href="begin.html">begin</a><br> <a href="end.html">end</a><br> <a href="rbegin.html">rbegin</a> </div> </div> </td> </tr> </table></body></html><hr> <div class="name-format"> size </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <set> <strong>size_type</strong> size() const;</pre> <p>The size() function returns the number of elements in the current multiset.</p> <div class="related-name-format"> Related topics: </div> <div class="related-content"> (C++ Strings) <a href="../cppstring/capacity.html">capacity</a><br> <a href="empty.html">empty</a><br> (C++ Strings) <a href="../cppstring/length.html">length</a><br> <a href="max_size.html">max_size</a><br> (C++ Strings) <a href="../cppstring/resize.html">resize</a> </div> </div> </td> </tr> </table></body></html><hr> <div class="name-format"> swap </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <set> void swap( container& from );</pre> <p>The swap() function exchanges the elements of the current multiset with those of <em>from</em>. This function operates in <a href= "../complexity.html">constant time</a>.</p> <p>For example, the following code uses the swap() function to exchange the values of two strings:</p> <pre class="example-code"> string first( "This comes first" ); string second( "And this is second" ); first.swap( second ); cout << first << endl; cout << second << endl; </pre> <p>The above code displays:</p> <pre class="example-code"> And this is second This comes first </pre> <div class="related-name-format"> Related topics: </div> <div class="related-content"> (C++ Lists) <a href="../cpplist/splice.html">splice</a> </div> </div> </td> </tr> </table></body></html><hr> <div class="name-format"> upper_bound </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <set> iterator upper_bound( const <a href="../containers.html">key_type</a>& key );</pre> <p>The function upper_bound() returns an iterator to the first element in the multiset with a key greater than <em>key</em>.</p> <div class="related-name-format"> Related topics: </div> <div class="related-content"> <a href="lower_bound.html">lower_bound</a> </div> </div> </td> </tr> </table></body></html><hr> <div class="name-format"> value_comp </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <set> value_compare value_comp() const;</pre> <p>The value_comp() function returns the function that compares values.</p> <p>value_comp() runs in <a href="../complexity.html">constant time</a>.</p> <div class="related-name-format"> Related topics: </div> <div class="related-content"> <a href="key_comp.html">key_comp</a> </div> </div> </td> </tr> </table></body></html><hr></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -