⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 all.html

📁 从www.CppReference.com打包的C++参考手册
💻 HTML
📖 第 1 页 / 共 3 页
字号:
</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 &lt;deque&gt;  <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 &lt;deque&gt;  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 &lt;deque&gt;  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 &lt;deque&gt;  void push_back( const <a href="../containers.html">TYPE</a>&amp; 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&lt;int&gt; the_list;   for( int i = 0; i &lt; 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 &lt;deque&gt;  void push_front( const <a href="../containers.html">TYPE</a>&amp; 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 &lt;deque&gt;  <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 &lt;deque&gt;  <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 &lt;deque&gt;  void resize( <strong>size_type</strong> num, const <a href="../containers.html">TYPE</a>&amp; 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    &amp; 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 &lt;deque&gt;  <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 &lt;deque&gt;  void swap( container&amp; 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( &quot;This comes first&quot; );   string second( &quot;And this is second&quot; );   first.swap( second );   cout &lt;&lt; first &lt;&lt; endl;   cout &lt;&lt; second &lt;&lt; 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 + -