📄 all.html
字号:
</pre> <div class="related-name-format"> Related topics: </div> <div class="related-content"> <a href="assign.html">assign</a><br> <a href="erase.html">erase</a><br> (C++ Lists) <a href="../cpplist/merge.html">merge</a><br> <a href="push_back.html">push_back</a><br> <a href="push_front.html">push_front</a><br> (C++ Lists) <a href="../cpplist/splice.html">splice</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 <deque> <strong>size_type</strong> max_size() const;</pre> <p>The max_size() function returns the maximum number of elements that the dequeue 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 dequeue and the the number of elements that the dequeue 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"> pop_back </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <deque> void pop_back();</pre> <p>The pop_back() function removes the last element of the dequeue.</p> <p>pop_back() runs in <a href="../complexity.html">constant time</a>.</p> <div class="related-name-format"> Related topics: </div> <div class="related-content"> <a href="back.html">back</a><br> <a href="erase.html">erase</a><br> <a href="pop_front.html">pop_front</a><br> <a href="push_back.html">push_back</a> </div> </div> </td> </tr> </table></body></html><hr> <div class="name-format"> pop_front </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <deque> void pop_front();</pre> <p>The function pop_front() removes the first element of the dequeue.</p> <p>The pop_front() function runs in <a href= "../complexity.html">constant time</a>.</p> <div class="related-name-format"> Related topics: </div> <div class="related-content"> <a href="erase.html">erase</a><br> <a href="front.html">front</a><br> <a href="pop_back.html">pop_back</a><br> <a href="push_front.html">push_front</a> </div> </div> </td> </tr> </table></body></html><hr> <div class="name-format"> push_back </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <deque> void push_back( const <a href="../containers.html">TYPE</a>& val );</pre> <p>The push_back() function appends <em>val</em> to the end of the dequeue.</p> <p>For example, the following code puts 10 integers into a list:</p> <pre class="example-code"> list<int> the_list; for( int i = 0; i < 10; i++ ) the_list.push_back( i ); </pre> <p>When displayed, the resulting list would look like this:</p> <pre class="example-code"> 0 1 2 3 4 5 6 7 8 9 </pre> <p>push_back() runs in <a href="../complexity.html">constant time</a>.</p> <div class="related-name-format"> Related topics: </div> <div class="related-content"> <a href="assign.html">assign</a><br> <a href="insert.html">insert</a><br> <a href="pop_back.html">pop_back</a><br> <a href="push_front.html">push_front</a> </div> </div> </td> </tr> </table></body></html><hr> <div class="name-format"> push_front </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <deque> void push_front( const <a href="../containers.html">TYPE</a>& val );</pre> <p>The push_front() function inserts <em>val</em> at the beginning of dequeue.</p> <p>push_front() runs in <a href="../complexity.html">constant time</a>.</p> <div class="related-name-format"> Related topics: </div> <div class="related-content"> <a href="assign.html">assign</a><br> <a href="front.html">front</a><br> <a href="insert.html">insert</a><br> <a href="pop_front.html">pop_front</a><br> <a href="push_back.html">push_back</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 <deque> <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 dequeue.</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 <deque> <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 dequeue.</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"> resize </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <deque> void resize( <strong>size_type</strong> num, const <a href="../containers.html">TYPE</a>& val = <a href="../containers.html">TYPE</a>() );</pre> <p>The function resize() changes the size of the dequeue to <em>size</em>. If <em>val</em> is specified then any newly-created elements will be initialized to have a value of <em>val</em>.</p> <p>This function runs in <a href="../complexity.html">linear time</a>.</p> <div class="related-name-format"> Related topics: </div> <div class="related-content"> (C++ Multimaps) <a href= "../cppmultimap/multimap_constructors.html">Multimap constructors & destructors</a><br> (C++ Strings) <a href="../cppstring/capacity.html">capacity</a><br> <a href="size.html">size</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 <deque> <strong>size_type</strong> size() const;</pre> <p>The size() function returns the number of elements in the current dequeue.</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> <a href="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 <deque> void swap( container& from );</pre> <p>The swap() function exchanges the elements of the current dequeue 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></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -