You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SQA-Homework/gcov & lcov/output/9/bits/stl_deque.h.gcov.html

2471 lines
299 KiB

3 years ago
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>LCOV - test.info - 9/bits/stl_deque.h</title>
<link rel="stylesheet" type="text/css" href="../../gcov.css">
</head>
<body>
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr><td class="title">LCOV - code coverage report</td></tr>
<tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
<tr>
<td width="100%">
<table cellpadding=1 border=0 width="100%">
<tr>
<td width="10%" class="headerItem">Current view:</td>
<td width="35%" class="headerValue"><a href="../../index.html">top level</a> - <a href="index.html">9/bits</a> - stl_deque.h<span style="font-size: 80%;"> (source / <a href="stl_deque.h.func-sort-c.html">functions</a>)</span></td>
<td width="5%"></td>
<td width="15%"></td>
<td width="10%" class="headerCovTableHead">Hit</td>
<td width="10%" class="headerCovTableHead">Total</td>
<td width="15%" class="headerCovTableHead">Coverage</td>
</tr>
<tr>
<td class="headerItem">Test:</td>
<td class="headerValue">test.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">99</td>
<td class="headerCovTableEntry">134</td>
<td class="headerCovTableEntryLo">73.9 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2022-06-06 23:58:34</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">30</td>
<td class="headerCovTableEntry">36</td>
<td class="headerCovTableEntryMed">83.3 %</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td class="headerItem">Branches:</td>
<td class="headerCovTableEntry">12</td>
<td class="headerCovTableEntry">24</td>
<td class="headerCovTableEntryLo">50.0 %</td>
</tr>
<tr><td><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
</table>
</td>
</tr>
<tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
</table>
<table cellpadding=0 cellspacing=0 border=0>
<tr>
<td><br></td>
</tr>
<tr>
<td>
<pre class="sourceHeading"> Branch data Line data Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum"> 1 </span> : : // Deque implementation -*- C++ -*-</a>
<a name="2"><span class="lineNum"> 2 </span> : : </a>
<a name="3"><span class="lineNum"> 3 </span> : : // Copyright (C) 2001-2019 Free Software Foundation, Inc.</a>
<a name="4"><span class="lineNum"> 4 </span> : : //</a>
<a name="5"><span class="lineNum"> 5 </span> : : // This file is part of the GNU ISO C++ Library. This library is free</a>
<a name="6"><span class="lineNum"> 6 </span> : : // software; you can redistribute it and/or modify it under the</a>
<a name="7"><span class="lineNum"> 7 </span> : : // terms of the GNU General Public License as published by the</a>
<a name="8"><span class="lineNum"> 8 </span> : : // Free Software Foundation; either version 3, or (at your option)</a>
<a name="9"><span class="lineNum"> 9 </span> : : // any later version.</a>
<a name="10"><span class="lineNum"> 10 </span> : : </a>
<a name="11"><span class="lineNum"> 11 </span> : : // This library is distributed in the hope that it will be useful,</a>
<a name="12"><span class="lineNum"> 12 </span> : : // but WITHOUT ANY WARRANTY; without even the implied warranty of</a>
<a name="13"><span class="lineNum"> 13 </span> : : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</a>
<a name="14"><span class="lineNum"> 14 </span> : : // GNU General Public License for more details.</a>
<a name="15"><span class="lineNum"> 15 </span> : : </a>
<a name="16"><span class="lineNum"> 16 </span> : : // Under Section 7 of GPL version 3, you are granted additional</a>
<a name="17"><span class="lineNum"> 17 </span> : : // permissions described in the GCC Runtime Library Exception, version</a>
<a name="18"><span class="lineNum"> 18 </span> : : // 3.1, as published by the Free Software Foundation.</a>
<a name="19"><span class="lineNum"> 19 </span> : : </a>
<a name="20"><span class="lineNum"> 20 </span> : : // You should have received a copy of the GNU General Public License and</a>
<a name="21"><span class="lineNum"> 21 </span> : : // a copy of the GCC Runtime Library Exception along with this program;</a>
<a name="22"><span class="lineNum"> 22 </span> : : // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see</a>
<a name="23"><span class="lineNum"> 23 </span> : : // &lt;http://www.gnu.org/licenses/&gt;.</a>
<a name="24"><span class="lineNum"> 24 </span> : : </a>
<a name="25"><span class="lineNum"> 25 </span> : : /*</a>
<a name="26"><span class="lineNum"> 26 </span> : : *</a>
<a name="27"><span class="lineNum"> 27 </span> : : * Copyright (c) 1994</a>
<a name="28"><span class="lineNum"> 28 </span> : : * Hewlett-Packard Company</a>
<a name="29"><span class="lineNum"> 29 </span> : : *</a>
<a name="30"><span class="lineNum"> 30 </span> : : * Permission to use, copy, modify, distribute and sell this software</a>
<a name="31"><span class="lineNum"> 31 </span> : : * and its documentation for any purpose is hereby granted without fee,</a>
<a name="32"><span class="lineNum"> 32 </span> : : * provided that the above copyright notice appear in all copies and</a>
<a name="33"><span class="lineNum"> 33 </span> : : * that both that copyright notice and this permission notice appear</a>
<a name="34"><span class="lineNum"> 34 </span> : : * in supporting documentation. Hewlett-Packard Company makes no</a>
<a name="35"><span class="lineNum"> 35 </span> : : * representations about the suitability of this software for any</a>
<a name="36"><span class="lineNum"> 36 </span> : : * purpose. It is provided &quot;as is&quot; without express or implied warranty.</a>
<a name="37"><span class="lineNum"> 37 </span> : : *</a>
<a name="38"><span class="lineNum"> 38 </span> : : *</a>
<a name="39"><span class="lineNum"> 39 </span> : : * Copyright (c) 1997</a>
<a name="40"><span class="lineNum"> 40 </span> : : * Silicon Graphics Computer Systems, Inc.</a>
<a name="41"><span class="lineNum"> 41 </span> : : *</a>
<a name="42"><span class="lineNum"> 42 </span> : : * Permission to use, copy, modify, distribute and sell this software</a>
<a name="43"><span class="lineNum"> 43 </span> : : * and its documentation for any purpose is hereby granted without fee,</a>
<a name="44"><span class="lineNum"> 44 </span> : : * provided that the above copyright notice appear in all copies and</a>
<a name="45"><span class="lineNum"> 45 </span> : : * that both that copyright notice and this permission notice appear</a>
<a name="46"><span class="lineNum"> 46 </span> : : * in supporting documentation. Silicon Graphics makes no</a>
<a name="47"><span class="lineNum"> 47 </span> : : * representations about the suitability of this software for any</a>
<a name="48"><span class="lineNum"> 48 </span> : : * purpose. It is provided &quot;as is&quot; without express or implied warranty.</a>
<a name="49"><span class="lineNum"> 49 </span> : : */</a>
<a name="50"><span class="lineNum"> 50 </span> : : </a>
<a name="51"><span class="lineNum"> 51 </span> : : /** @file bits/stl_deque.h</a>
<a name="52"><span class="lineNum"> 52 </span> : : * This is an internal header file, included by other library headers.</a>
<a name="53"><span class="lineNum"> 53 </span> : : * Do not attempt to use it directly. @headername{deque}</a>
<a name="54"><span class="lineNum"> 54 </span> : : */</a>
<a name="55"><span class="lineNum"> 55 </span> : : </a>
<a name="56"><span class="lineNum"> 56 </span> : : #ifndef _STL_DEQUE_H</a>
<a name="57"><span class="lineNum"> 57 </span> : : #define _STL_DEQUE_H 1</a>
<a name="58"><span class="lineNum"> 58 </span> : : </a>
<a name="59"><span class="lineNum"> 59 </span> : : #include &lt;bits/concept_check.h&gt;</a>
<a name="60"><span class="lineNum"> 60 </span> : : #include &lt;bits/stl_iterator_base_types.h&gt;</a>
<a name="61"><span class="lineNum"> 61 </span> : : #include &lt;bits/stl_iterator_base_funcs.h&gt;</a>
<a name="62"><span class="lineNum"> 62 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="63"><span class="lineNum"> 63 </span> : : #include &lt;initializer_list&gt;</a>
<a name="64"><span class="lineNum"> 64 </span> : : #include &lt;bits/stl_uninitialized.h&gt; // for __is_bitwise_relocatable</a>
<a name="65"><span class="lineNum"> 65 </span> : : #endif</a>
<a name="66"><span class="lineNum"> 66 </span> : : </a>
<a name="67"><span class="lineNum"> 67 </span> : : #include &lt;debug/assertions.h&gt;</a>
<a name="68"><span class="lineNum"> 68 </span> : : </a>
<a name="69"><span class="lineNum"> 69 </span> : : namespace std _GLIBCXX_VISIBILITY(default)</a>
<a name="70"><span class="lineNum"> 70 </span> : : {</a>
<a name="71"><span class="lineNum"> 71 </span> : : _GLIBCXX_BEGIN_NAMESPACE_VERSION</a>
<a name="72"><span class="lineNum"> 72 </span> : : _GLIBCXX_BEGIN_NAMESPACE_CONTAINER</a>
<a name="73"><span class="lineNum"> 73 </span> : : </a>
<a name="74"><span class="lineNum"> 74 </span> : : /**</a>
<a name="75"><span class="lineNum"> 75 </span> : : * @brief This function controls the size of memory nodes.</a>
<a name="76"><span class="lineNum"> 76 </span> : : * @param __size The size of an element.</a>
<a name="77"><span class="lineNum"> 77 </span> : : * @return The number (not byte size) of elements per node.</a>
<a name="78"><span class="lineNum"> 78 </span> : : *</a>
<a name="79"><span class="lineNum"> 79 </span> : : * This function started off as a compiler kludge from SGI, but</a>
<a name="80"><span class="lineNum"> 80 </span> : : * seems to be a useful wrapper around a repeated constant</a>
<a name="81"><span class="lineNum"> 81 </span> : : * expression. The @b 512 is tunable (and no other code needs to</a>
<a name="82"><span class="lineNum"> 82 </span> : : * change), but no investigation has been done since inheriting the</a>
<a name="83"><span class="lineNum"> 83 </span> : : * SGI code. Touch _GLIBCXX_DEQUE_BUF_SIZE only if you know what</a>
<a name="84"><span class="lineNum"> 84 </span> : : * you are doing, however: changing it breaks the binary</a>
<a name="85"><span class="lineNum"> 85 </span> : : * compatibility!!</a>
<a name="86"><span class="lineNum"> 86 </span> : : */</a>
<a name="87"><span class="lineNum"> 87 </span> : : </a>
<a name="88"><span class="lineNum"> 88 </span> : : #ifndef _GLIBCXX_DEQUE_BUF_SIZE</a>
<a name="89"><span class="lineNum"> 89 </span> : : #define _GLIBCXX_DEQUE_BUF_SIZE 512</a>
<a name="90"><span class="lineNum"> 90 </span> : : #endif</a>
<a name="91"><span class="lineNum"> 91 </span> : : </a>
<a name="92"><span class="lineNum"> 92 </span> : : _GLIBCXX_CONSTEXPR inline size_t</a>
<a name="93"><span class="lineNum"> 93 </span> :<span class="lineCov"> 6 : __deque_buf_size(size_t __size)</span></a>
<a name="94"><span class="lineNum"> 94 </span> : : { return (__size &lt; _GLIBCXX_DEQUE_BUF_SIZE</a>
<a name="95"><span class="lineNum"> 95 </span> [<span class="branchCov" title="Branch 0 was taken 6 times"> + </span><span class="branchNoCov" title="Branch 1 was not taken"> - </span>]:<span class="lineCov"> 6 : ? size_t(_GLIBCXX_DEQUE_BUF_SIZE / __size) : size_t(1)); }</span></a>
<a name="96"><span class="lineNum"> 96 </span> : : </a>
<a name="97"><span class="lineNum"> 97 </span> : : </a>
<a name="98"><span class="lineNum"> 98 </span> : : /**</a>
<a name="99"><span class="lineNum"> 99 </span> : : * @brief A deque::iterator.</a>
<a name="100"><span class="lineNum"> 100 </span> : : *</a>
<a name="101"><span class="lineNum"> 101 </span> : : * Quite a bit of intelligence here. Much of the functionality of</a>
<a name="102"><span class="lineNum"> 102 </span> : : * deque is actually passed off to this class. A deque holds two</a>
<a name="103"><span class="lineNum"> 103 </span> : : * of these internally, marking its valid range. Access to</a>
<a name="104"><span class="lineNum"> 104 </span> : : * elements is done as offsets of either of those two, relying on</a>
<a name="105"><span class="lineNum"> 105 </span> : : * operator overloading in this class.</a>
<a name="106"><span class="lineNum"> 106 </span> : : *</a>
<a name="107"><span class="lineNum"> 107 </span> : : * All the functions are op overloads except for _M_set_node.</a>
<a name="108"><span class="lineNum"> 108 </span> : : */</a>
<a name="109"><span class="lineNum"> 109 </span> : : template&lt;typename _Tp, typename _Ref, typename _Ptr&gt;</a>
<a name="110"><span class="lineNum"> 110 </span> : : struct _Deque_iterator</a>
<a name="111"><span class="lineNum"> 111 </span> : : {</a>
<a name="112"><span class="lineNum"> 112 </span> : : #if __cplusplus &lt; 201103L</a>
<a name="113"><span class="lineNum"> 113 </span> : : typedef _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt; iterator;</a>
<a name="114"><span class="lineNum"> 114 </span> : : typedef _Deque_iterator&lt;_Tp, const _Tp&amp;, const _Tp*&gt; const_iterator;</a>
<a name="115"><span class="lineNum"> 115 </span> : : typedef _Tp* _Elt_pointer;</a>
<a name="116"><span class="lineNum"> 116 </span> : : typedef _Tp** _Map_pointer;</a>
<a name="117"><span class="lineNum"> 117 </span> : : #else</a>
<a name="118"><span class="lineNum"> 118 </span> : : private:</a>
<a name="119"><span class="lineNum"> 119 </span> : : template&lt;typename _Up&gt;</a>
<a name="120"><span class="lineNum"> 120 </span> : : using __ptr_to = typename pointer_traits&lt;_Ptr&gt;::template rebind&lt;_Up&gt;;</a>
<a name="121"><span class="lineNum"> 121 </span> : : template&lt;typename _CvTp&gt;</a>
<a name="122"><span class="lineNum"> 122 </span> : : using __iter = _Deque_iterator&lt;_Tp, _CvTp&amp;, __ptr_to&lt;_CvTp&gt;&gt;;</a>
<a name="123"><span class="lineNum"> 123 </span> : : public:</a>
<a name="124"><span class="lineNum"> 124 </span> : : typedef __iter&lt;_Tp&gt; iterator;</a>
<a name="125"><span class="lineNum"> 125 </span> : : typedef __iter&lt;const _Tp&gt; const_iterator;</a>
<a name="126"><span class="lineNum"> 126 </span> : : typedef __ptr_to&lt;_Tp&gt; _Elt_pointer;</a>
<a name="127"><span class="lineNum"> 127 </span> : : typedef __ptr_to&lt;_Elt_pointer&gt; _Map_pointer;</a>
<a name="128"><span class="lineNum"> 128 </span> : : #endif</a>
<a name="129"><span class="lineNum"> 129 </span> : : </a>
<a name="130"><span class="lineNum"> 130 </span> :<span class="lineCov"> 2 : static size_t _S_buffer_size() _GLIBCXX_NOEXCEPT</span></a>
<a name="131"><span class="lineNum"> 131 </span> :<span class="lineCov"> 2 : { return __deque_buf_size(sizeof(_Tp)); }</span></a>
<a name="132"><span class="lineNum"> 132 </span> : : </a>
<a name="133"><span class="lineNum"> 133 </span> : : typedef std::random_access_iterator_tag iterator_category;</a>
<a name="134"><span class="lineNum"> 134 </span> : : typedef _Tp value_type;</a>
<a name="135"><span class="lineNum"> 135 </span> : : typedef _Ptr pointer;</a>
<a name="136"><span class="lineNum"> 136 </span> : : typedef _Ref reference;</a>
<a name="137"><span class="lineNum"> 137 </span> : : typedef size_t size_type;</a>
<a name="138"><span class="lineNum"> 138 </span> : : typedef ptrdiff_t difference_type;</a>
<a name="139"><span class="lineNum"> 139 </span> : : typedef _Deque_iterator _Self;</a>
<a name="140"><span class="lineNum"> 140 </span> : : </a>
<a name="141"><span class="lineNum"> 141 </span> : : _Elt_pointer _M_cur;</a>
<a name="142"><span class="lineNum"> 142 </span> : : _Elt_pointer _M_first;</a>
<a name="143"><span class="lineNum"> 143 </span> : : _Elt_pointer _M_last;</a>
<a name="144"><span class="lineNum"> 144 </span> : : _Map_pointer _M_node;</a>
<a name="145"><span class="lineNum"> 145 </span> : : </a>
<a name="146"><span class="lineNum"> 146 </span> : : _Deque_iterator(_Elt_pointer __x, _Map_pointer __y) _GLIBCXX_NOEXCEPT</a>
<a name="147"><span class="lineNum"> 147 </span> : : : _M_cur(__x), _M_first(*__y),</a>
<a name="148"><span class="lineNum"> 148 </span> : : _M_last(*__y + _S_buffer_size()), _M_node(__y) { }</a>
<a name="149"><span class="lineNum"> 149 </span> : : </a>
<a name="150"><span class="lineNum"> 150 </span> :<span class="lineCov"> 2 : _Deque_iterator() _GLIBCXX_NOEXCEPT</span></a>
<a name="151"><span class="lineNum"> 151 </span> :<span class="lineCov"> 2 : : _M_cur(), _M_first(), _M_last(), _M_node() { }</span></a>
<a name="152"><span class="lineNum"> 152 </span> : : </a>
<a name="153"><span class="lineNum"> 153 </span> : : #if __cplusplus &lt; 201103L</a>
<a name="154"><span class="lineNum"> 154 </span> : : // Conversion from iterator to const_iterator.</a>
<a name="155"><span class="lineNum"> 155 </span> : : _Deque_iterator(const iterator&amp; __x) _GLIBCXX_NOEXCEPT</a>
<a name="156"><span class="lineNum"> 156 </span> : : : _M_cur(__x._M_cur), _M_first(__x._M_first),</a>
<a name="157"><span class="lineNum"> 157 </span> : : _M_last(__x._M_last), _M_node(__x._M_node) { }</a>
<a name="158"><span class="lineNum"> 158 </span> : : #else</a>
<a name="159"><span class="lineNum"> 159 </span> : : // Conversion from iterator to const_iterator.</a>
<a name="160"><span class="lineNum"> 160 </span> : : template&lt;typename _Iter,</a>
<a name="161"><span class="lineNum"> 161 </span> : : typename = _Require&lt;is_same&lt;_Self, const_iterator&gt;,</a>
<a name="162"><span class="lineNum"> 162 </span> : : is_same&lt;_Iter, iterator&gt;&gt;&gt;</a>
<a name="163"><span class="lineNum"> 163 </span> : : _Deque_iterator(const _Iter&amp; __x) noexcept</a>
<a name="164"><span class="lineNum"> 164 </span> : : : _M_cur(__x._M_cur), _M_first(__x._M_first),</a>
<a name="165"><span class="lineNum"> 165 </span> : : _M_last(__x._M_last), _M_node(__x._M_node) { }</a>
<a name="166"><span class="lineNum"> 166 </span> : : </a>
<a name="167"><span class="lineNum"> 167 </span> :<span class="lineCov"> 5 : _Deque_iterator(const _Deque_iterator&amp; __x) noexcept</span></a>
<a name="168"><span class="lineNum"> 168 </span> :<span class="lineCov"> 5 : : _M_cur(__x._M_cur), _M_first(__x._M_first),</span></a>
<a name="169"><span class="lineNum"> 169 </span> :<span class="lineCov"> 5 : _M_last(__x._M_last), _M_node(__x._M_node) { }</span></a>
<a name="170"><span class="lineNum"> 170 </span> : : </a>
<a name="171"><span class="lineNum"> 171 </span> : : _Deque_iterator&amp; operator=(const _Deque_iterator&amp;) = default;</a>
<a name="172"><span class="lineNum"> 172 </span> : : #endif</a>
<a name="173"><span class="lineNum"> 173 </span> : : </a>
<a name="174"><span class="lineNum"> 174 </span> : : iterator</a>
<a name="175"><span class="lineNum"> 175 </span> : : _M_const_cast() const _GLIBCXX_NOEXCEPT</a>
<a name="176"><span class="lineNum"> 176 </span> : : { return iterator(_M_cur, _M_node); }</a>
<a name="177"><span class="lineNum"> 177 </span> : : </a>
<a name="178"><span class="lineNum"> 178 </span> : : reference</a>
<a name="179"><span class="lineNum"> 179 </span> :<span class="lineCov"> 3 : operator*() const _GLIBCXX_NOEXCEPT</span></a>
<a name="180"><span class="lineNum"> 180 </span> :<span class="lineCov"> 3 : { return *_M_cur; }</span></a>
<a name="181"><span class="lineNum"> 181 </span> : : </a>
<a name="182"><span class="lineNum"> 182 </span> : : pointer</a>
<a name="183"><span class="lineNum"> 183 </span> : : operator-&gt;() const _GLIBCXX_NOEXCEPT</a>
<a name="184"><span class="lineNum"> 184 </span> : : { return _M_cur; }</a>
<a name="185"><span class="lineNum"> 185 </span> : : </a>
<a name="186"><span class="lineNum"> 186 </span> : : _Self&amp;</a>
<a name="187"><span class="lineNum"> 187 </span> : : operator++() _GLIBCXX_NOEXCEPT</a>
<a name="188"><span class="lineNum"> 188 </span> : : {</a>
<a name="189"><span class="lineNum"> 189 </span> : : ++_M_cur;</a>
<a name="190"><span class="lineNum"> 190 </span> : : if (_M_cur == _M_last)</a>
<a name="191"><span class="lineNum"> 191 </span> : : {</a>
<a name="192"><span class="lineNum"> 192 </span> : : _M_set_node(_M_node + 1);</a>
<a name="193"><span class="lineNum"> 193 </span> : : _M_cur = _M_first;</a>
<a name="194"><span class="lineNum"> 194 </span> : : }</a>
<a name="195"><span class="lineNum"> 195 </span> : : return *this;</a>
<a name="196"><span class="lineNum"> 196 </span> : : }</a>
<a name="197"><span class="lineNum"> 197 </span> : : </a>
<a name="198"><span class="lineNum"> 198 </span> : : _Self</a>
<a name="199"><span class="lineNum"> 199 </span> : : operator++(int) _GLIBCXX_NOEXCEPT</a>
<a name="200"><span class="lineNum"> 200 </span> : : {</a>
<a name="201"><span class="lineNum"> 201 </span> : : _Self __tmp = *this;</a>
<a name="202"><span class="lineNum"> 202 </span> : : ++*this;</a>
<a name="203"><span class="lineNum"> 203 </span> : : return __tmp;</a>
<a name="204"><span class="lineNum"> 204 </span> : : }</a>
<a name="205"><span class="lineNum"> 205 </span> : : </a>
<a name="206"><span class="lineNum"> 206 </span> : : _Self&amp;</a>
<a name="207"><span class="lineNum"> 207 </span> :<span class="lineCov"> 3 : operator--() _GLIBCXX_NOEXCEPT</span></a>
<a name="208"><span class="lineNum"> 208 </span> : : {</a>
<a name="209"><span class="lineNum"> 209 </span> [<span class="branchNoCov" title="Branch 0 was not taken"> - </span><span class="branchCov" title="Branch 1 was taken 3 times"> + </span>]:<span class="lineCov"> 3 : if (_M_cur == _M_first)</span></a>
<a name="210"><span class="lineNum"> 210 </span> : : {</a>
<a name="211"><span class="lineNum"> 211 </span> :<span class="lineNoCov"> 0 : _M_set_node(_M_node - 1);</span></a>
<a name="212"><span class="lineNum"> 212 </span> :<span class="lineNoCov"> 0 : _M_cur = _M_last;</span></a>
<a name="213"><span class="lineNum"> 213 </span> : : }</a>
<a name="214"><span class="lineNum"> 214 </span> :<span class="lineCov"> 3 : --_M_cur;</span></a>
<a name="215"><span class="lineNum"> 215 </span> :<span class="lineCov"> 3 : return *this;</span></a>
<a name="216"><span class="lineNum"> 216 </span> : : }</a>
<a name="217"><span class="lineNum"> 217 </span> : : </a>
<a name="218"><span class="lineNum"> 218 </span> : : _Self</a>
<a name="219"><span class="lineNum"> 219 </span> : : operator--(int) _GLIBCXX_NOEXCEPT</a>
<a name="220"><span class="lineNum"> 220 </span> : : {</a>
<a name="221"><span class="lineNum"> 221 </span> : : _Self __tmp = *this;</a>
<a name="222"><span class="lineNum"> 222 </span> : : --*this;</a>
<a name="223"><span class="lineNum"> 223 </span> : : return __tmp;</a>
<a name="224"><span class="lineNum"> 224 </span> : : }</a>
<a name="225"><span class="lineNum"> 225 </span> : : </a>
<a name="226"><span class="lineNum"> 226 </span> : : _Self&amp;</a>
<a name="227"><span class="lineNum"> 227 </span> : : operator+=(difference_type __n) _GLIBCXX_NOEXCEPT</a>
<a name="228"><span class="lineNum"> 228 </span> : : {</a>
<a name="229"><span class="lineNum"> 229 </span> : : const difference_type __offset = __n + (_M_cur - _M_first);</a>
<a name="230"><span class="lineNum"> 230 </span> : : if (__offset &gt;= 0 &amp;&amp; __offset &lt; difference_type(_S_buffer_size()))</a>
<a name="231"><span class="lineNum"> 231 </span> : : _M_cur += __n;</a>
<a name="232"><span class="lineNum"> 232 </span> : : else</a>
<a name="233"><span class="lineNum"> 233 </span> : : {</a>
<a name="234"><span class="lineNum"> 234 </span> : : const difference_type __node_offset =</a>
<a name="235"><span class="lineNum"> 235 </span> : : __offset &gt; 0 ? __offset / difference_type(_S_buffer_size())</a>
<a name="236"><span class="lineNum"> 236 </span> : : : -difference_type((-__offset - 1)</a>
<a name="237"><span class="lineNum"> 237 </span> : : / _S_buffer_size()) - 1;</a>
<a name="238"><span class="lineNum"> 238 </span> : : _M_set_node(_M_node + __node_offset);</a>
<a name="239"><span class="lineNum"> 239 </span> : : _M_cur = _M_first + (__offset - __node_offset</a>
<a name="240"><span class="lineNum"> 240 </span> : : * difference_type(_S_buffer_size()));</a>
<a name="241"><span class="lineNum"> 241 </span> : : }</a>
<a name="242"><span class="lineNum"> 242 </span> : : return *this;</a>
<a name="243"><span class="lineNum"> 243 </span> : : }</a>
<a name="244"><span class="lineNum"> 244 </span> : : </a>
<a name="245"><span class="lineNum"> 245 </span> : : _Self</a>
<a name="246"><span class="lineNum"> 246 </span> : : operator+(difference_type __n) const _GLIBCXX_NOEXCEPT</a>
<a name="247"><span class="lineNum"> 247 </span> : : {</a>
<a name="248"><span class="lineNum"> 248 </span> : : _Self __tmp = *this;</a>
<a name="249"><span class="lineNum"> 249 </span> : : return __tmp += __n;</a>
<a name="250"><span class="lineNum"> 250 </span> : : }</a>
<a name="251"><span class="lineNum"> 251 </span> : : </a>
<a name="252"><span class="lineNum"> 252 </span> : : _Self&amp;</a>
<a name="253"><span class="lineNum"> 253 </span> : : operator-=(difference_type __n) _GLIBCXX_NOEXCEPT</a>
<a name="254"><span class="lineNum"> 254 </span> : : { return *this += -__n; }</a>
<a name="255"><span class="lineNum"> 255 </span> : : </a>
<a name="256"><span class="lineNum"> 256 </span> : : _Self</a>
<a name="257"><span class="lineNum"> 257 </span> : : operator-(difference_type __n) const _GLIBCXX_NOEXCEPT</a>
<a name="258"><span class="lineNum"> 258 </span> : : {</a>
<a name="259"><span class="lineNum"> 259 </span> : : _Self __tmp = *this;</a>
<a name="260"><span class="lineNum"> 260 </span> : : return __tmp -= __n;</a>
<a name="261"><span class="lineNum"> 261 </span> : : }</a>
<a name="262"><span class="lineNum"> 262 </span> : : </a>
<a name="263"><span class="lineNum"> 263 </span> : : reference</a>
<a name="264"><span class="lineNum"> 264 </span> : : operator[](difference_type __n) const _GLIBCXX_NOEXCEPT</a>
<a name="265"><span class="lineNum"> 265 </span> : : { return *(*this + __n); }</a>
<a name="266"><span class="lineNum"> 266 </span> : : </a>
<a name="267"><span class="lineNum"> 267 </span> : : /**</a>
<a name="268"><span class="lineNum"> 268 </span> : : * Prepares to traverse new_node. Sets everything except</a>
<a name="269"><span class="lineNum"> 269 </span> : : * _M_cur, which should therefore be set by the caller</a>
<a name="270"><span class="lineNum"> 270 </span> : : * immediately afterwards, based on _M_first and _M_last.</a>
<a name="271"><span class="lineNum"> 271 </span> : : */</a>
<a name="272"><span class="lineNum"> 272 </span> : : void</a>
<a name="273"><span class="lineNum"> 273 </span> :<span class="lineCov"> 2 : _M_set_node(_Map_pointer __new_node) _GLIBCXX_NOEXCEPT</span></a>
<a name="274"><span class="lineNum"> 274 </span> : : {</a>
<a name="275"><span class="lineNum"> 275 </span> :<span class="lineCov"> 2 : _M_node = __new_node;</span></a>
<a name="276"><span class="lineNum"> 276 </span> :<span class="lineCov"> 2 : _M_first = *__new_node;</span></a>
<a name="277"><span class="lineNum"> 277 </span> :<span class="lineCov"> 2 : _M_last = _M_first + difference_type(_S_buffer_size());</span></a>
<a name="278"><span class="lineNum"> 278 </span> :<span class="lineCov"> 2 : }</span></a>
<a name="279"><span class="lineNum"> 279 </span> : : };</a>
<a name="280"><span class="lineNum"> 280 </span> : : </a>
<a name="281"><span class="lineNum"> 281 </span> : : // Note: we also provide overloads whose operands are of the same type in</a>
<a name="282"><span class="lineNum"> 282 </span> : : // order to avoid ambiguous overload resolution when std::rel_ops operators</a>
<a name="283"><span class="lineNum"> 283 </span> : : // are in scope (for additional details, see libstdc++/3628)</a>
<a name="284"><span class="lineNum"> 284 </span> : : template&lt;typename _Tp, typename _Ref, typename _Ptr&gt;</a>
<a name="285"><span class="lineNum"> 285 </span> : : inline bool</a>
<a name="286"><span class="lineNum"> 286 </span> :<span class="lineCov"> 4 : operator==(const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __x,</span></a>
<a name="287"><span class="lineNum"> 287 </span> : : const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="288"><span class="lineNum"> 288 </span> :<span class="lineCov"> 4 : { return __x._M_cur == __y._M_cur; }</span></a>
<a name="289"><span class="lineNum"> 289 </span> : : </a>
<a name="290"><span class="lineNum"> 290 </span> : : template&lt;typename _Tp, typename _RefL, typename _PtrL,</a>
<a name="291"><span class="lineNum"> 291 </span> : : typename _RefR, typename _PtrR&gt;</a>
<a name="292"><span class="lineNum"> 292 </span> : : inline bool</a>
<a name="293"><span class="lineNum"> 293 </span> : : operator==(const _Deque_iterator&lt;_Tp, _RefL, _PtrL&gt;&amp; __x,</a>
<a name="294"><span class="lineNum"> 294 </span> : : const _Deque_iterator&lt;_Tp, _RefR, _PtrR&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="295"><span class="lineNum"> 295 </span> : : { return __x._M_cur == __y._M_cur; }</a>
<a name="296"><span class="lineNum"> 296 </span> : : </a>
<a name="297"><span class="lineNum"> 297 </span> : : template&lt;typename _Tp, typename _Ref, typename _Ptr&gt;</a>
<a name="298"><span class="lineNum"> 298 </span> : : inline bool</a>
<a name="299"><span class="lineNum"> 299 </span> : : operator!=(const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __x,</a>
<a name="300"><span class="lineNum"> 300 </span> : : const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="301"><span class="lineNum"> 301 </span> : : { return !(__x == __y); }</a>
<a name="302"><span class="lineNum"> 302 </span> : : </a>
<a name="303"><span class="lineNum"> 303 </span> : : template&lt;typename _Tp, typename _RefL, typename _PtrL,</a>
<a name="304"><span class="lineNum"> 304 </span> : : typename _RefR, typename _PtrR&gt;</a>
<a name="305"><span class="lineNum"> 305 </span> : : inline bool</a>
<a name="306"><span class="lineNum"> 306 </span> : : operator!=(const _Deque_iterator&lt;_Tp, _RefL, _PtrL&gt;&amp; __x,</a>
<a name="307"><span class="lineNum"> 307 </span> : : const _Deque_iterator&lt;_Tp, _RefR, _PtrR&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="308"><span class="lineNum"> 308 </span> : : { return !(__x == __y); }</a>
<a name="309"><span class="lineNum"> 309 </span> : : </a>
<a name="310"><span class="lineNum"> 310 </span> : : template&lt;typename _Tp, typename _Ref, typename _Ptr&gt;</a>
<a name="311"><span class="lineNum"> 311 </span> : : inline bool</a>
<a name="312"><span class="lineNum"> 312 </span> : : operator&lt;(const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __x,</a>
<a name="313"><span class="lineNum"> 313 </span> : : const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="314"><span class="lineNum"> 314 </span> : : { return (__x._M_node == __y._M_node) ? (__x._M_cur &lt; __y._M_cur)</a>
<a name="315"><span class="lineNum"> 315 </span> : : : (__x._M_node &lt; __y._M_node); }</a>
<a name="316"><span class="lineNum"> 316 </span> : : </a>
<a name="317"><span class="lineNum"> 317 </span> : : template&lt;typename _Tp, typename _RefL, typename _PtrL,</a>
<a name="318"><span class="lineNum"> 318 </span> : : typename _RefR, typename _PtrR&gt;</a>
<a name="319"><span class="lineNum"> 319 </span> : : inline bool</a>
<a name="320"><span class="lineNum"> 320 </span> : : operator&lt;(const _Deque_iterator&lt;_Tp, _RefL, _PtrL&gt;&amp; __x,</a>
<a name="321"><span class="lineNum"> 321 </span> : : const _Deque_iterator&lt;_Tp, _RefR, _PtrR&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="322"><span class="lineNum"> 322 </span> : : { return (__x._M_node == __y._M_node) ? (__x._M_cur &lt; __y._M_cur)</a>
<a name="323"><span class="lineNum"> 323 </span> : : : (__x._M_node &lt; __y._M_node); }</a>
<a name="324"><span class="lineNum"> 324 </span> : : </a>
<a name="325"><span class="lineNum"> 325 </span> : : template&lt;typename _Tp, typename _Ref, typename _Ptr&gt;</a>
<a name="326"><span class="lineNum"> 326 </span> : : inline bool</a>
<a name="327"><span class="lineNum"> 327 </span> : : operator&gt;(const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __x,</a>
<a name="328"><span class="lineNum"> 328 </span> : : const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="329"><span class="lineNum"> 329 </span> : : { return __y &lt; __x; }</a>
<a name="330"><span class="lineNum"> 330 </span> : : </a>
<a name="331"><span class="lineNum"> 331 </span> : : template&lt;typename _Tp, typename _RefL, typename _PtrL,</a>
<a name="332"><span class="lineNum"> 332 </span> : : typename _RefR, typename _PtrR&gt;</a>
<a name="333"><span class="lineNum"> 333 </span> : : inline bool</a>
<a name="334"><span class="lineNum"> 334 </span> : : operator&gt;(const _Deque_iterator&lt;_Tp, _RefL, _PtrL&gt;&amp; __x,</a>
<a name="335"><span class="lineNum"> 335 </span> : : const _Deque_iterator&lt;_Tp, _RefR, _PtrR&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="336"><span class="lineNum"> 336 </span> : : { return __y &lt; __x; }</a>
<a name="337"><span class="lineNum"> 337 </span> : : </a>
<a name="338"><span class="lineNum"> 338 </span> : : template&lt;typename _Tp, typename _Ref, typename _Ptr&gt;</a>
<a name="339"><span class="lineNum"> 339 </span> : : inline bool</a>
<a name="340"><span class="lineNum"> 340 </span> : : operator&lt;=(const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __x,</a>
<a name="341"><span class="lineNum"> 341 </span> : : const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="342"><span class="lineNum"> 342 </span> : : { return !(__y &lt; __x); }</a>
<a name="343"><span class="lineNum"> 343 </span> : : </a>
<a name="344"><span class="lineNum"> 344 </span> : : template&lt;typename _Tp, typename _RefL, typename _PtrL,</a>
<a name="345"><span class="lineNum"> 345 </span> : : typename _RefR, typename _PtrR&gt;</a>
<a name="346"><span class="lineNum"> 346 </span> : : inline bool</a>
<a name="347"><span class="lineNum"> 347 </span> : : operator&lt;=(const _Deque_iterator&lt;_Tp, _RefL, _PtrL&gt;&amp; __x,</a>
<a name="348"><span class="lineNum"> 348 </span> : : const _Deque_iterator&lt;_Tp, _RefR, _PtrR&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="349"><span class="lineNum"> 349 </span> : : { return !(__y &lt; __x); }</a>
<a name="350"><span class="lineNum"> 350 </span> : : </a>
<a name="351"><span class="lineNum"> 351 </span> : : template&lt;typename _Tp, typename _Ref, typename _Ptr&gt;</a>
<a name="352"><span class="lineNum"> 352 </span> : : inline bool</a>
<a name="353"><span class="lineNum"> 353 </span> : : operator&gt;=(const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __x,</a>
<a name="354"><span class="lineNum"> 354 </span> : : const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="355"><span class="lineNum"> 355 </span> : : { return !(__x &lt; __y); }</a>
<a name="356"><span class="lineNum"> 356 </span> : : </a>
<a name="357"><span class="lineNum"> 357 </span> : : template&lt;typename _Tp, typename _RefL, typename _PtrL,</a>
<a name="358"><span class="lineNum"> 358 </span> : : typename _RefR, typename _PtrR&gt;</a>
<a name="359"><span class="lineNum"> 359 </span> : : inline bool</a>
<a name="360"><span class="lineNum"> 360 </span> : : operator&gt;=(const _Deque_iterator&lt;_Tp, _RefL, _PtrL&gt;&amp; __x,</a>
<a name="361"><span class="lineNum"> 361 </span> : : const _Deque_iterator&lt;_Tp, _RefR, _PtrR&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="362"><span class="lineNum"> 362 </span> : : { return !(__x &lt; __y); }</a>
<a name="363"><span class="lineNum"> 363 </span> : : </a>
<a name="364"><span class="lineNum"> 364 </span> : : // _GLIBCXX_RESOLVE_LIB_DEFECTS</a>
<a name="365"><span class="lineNum"> 365 </span> : : // According to the resolution of DR179 not only the various comparison</a>
<a name="366"><span class="lineNum"> 366 </span> : : // operators but also operator- must accept mixed iterator/const_iterator</a>
<a name="367"><span class="lineNum"> 367 </span> : : // parameters.</a>
<a name="368"><span class="lineNum"> 368 </span> : : template&lt;typename _Tp, typename _Ref, typename _Ptr&gt;</a>
<a name="369"><span class="lineNum"> 369 </span> : : inline typename _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;::difference_type</a>
<a name="370"><span class="lineNum"> 370 </span> :<span class="lineNoCov"> 0 : operator-(const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __x,</span></a>
<a name="371"><span class="lineNum"> 371 </span> : : const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="372"><span class="lineNum"> 372 </span> : : {</a>
<a name="373"><span class="lineNum"> 373 </span> : : return typename _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;::difference_type</a>
<a name="374"><span class="lineNum"> 374 </span> :<span class="lineNoCov"> 0 : (_Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;::_S_buffer_size())</span></a>
<a name="375"><span class="lineNum"> 375 </span> :<span class="lineNoCov"> 0 : * (__x._M_node - __y._M_node - 1) + (__x._M_cur - __x._M_first)</span></a>
<a name="376"><span class="lineNum"> 376 </span> :<span class="lineNoCov"> 0 : + (__y._M_last - __y._M_cur);</span></a>
<a name="377"><span class="lineNum"> 377 </span> : : }</a>
<a name="378"><span class="lineNum"> 378 </span> : : </a>
<a name="379"><span class="lineNum"> 379 </span> : : template&lt;typename _Tp, typename _RefL, typename _PtrL,</a>
<a name="380"><span class="lineNum"> 380 </span> : : typename _RefR, typename _PtrR&gt;</a>
<a name="381"><span class="lineNum"> 381 </span> : : inline typename _Deque_iterator&lt;_Tp, _RefL, _PtrL&gt;::difference_type</a>
<a name="382"><span class="lineNum"> 382 </span> : : operator-(const _Deque_iterator&lt;_Tp, _RefL, _PtrL&gt;&amp; __x,</a>
<a name="383"><span class="lineNum"> 383 </span> : : const _Deque_iterator&lt;_Tp, _RefR, _PtrR&gt;&amp; __y) _GLIBCXX_NOEXCEPT</a>
<a name="384"><span class="lineNum"> 384 </span> : : {</a>
<a name="385"><span class="lineNum"> 385 </span> : : return typename _Deque_iterator&lt;_Tp, _RefL, _PtrL&gt;::difference_type</a>
<a name="386"><span class="lineNum"> 386 </span> : : (_Deque_iterator&lt;_Tp, _RefL, _PtrL&gt;::_S_buffer_size())</a>
<a name="387"><span class="lineNum"> 387 </span> : : * (__x._M_node - __y._M_node - 1) + (__x._M_cur - __x._M_first)</a>
<a name="388"><span class="lineNum"> 388 </span> : : + (__y._M_last - __y._M_cur);</a>
<a name="389"><span class="lineNum"> 389 </span> : : }</a>
<a name="390"><span class="lineNum"> 390 </span> : : </a>
<a name="391"><span class="lineNum"> 391 </span> : : template&lt;typename _Tp, typename _Ref, typename _Ptr&gt;</a>
<a name="392"><span class="lineNum"> 392 </span> : : inline _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;</a>
<a name="393"><span class="lineNum"> 393 </span> : : operator+(ptrdiff_t __n, const _Deque_iterator&lt;_Tp, _Ref, _Ptr&gt;&amp; __x)</a>
<a name="394"><span class="lineNum"> 394 </span> : : _GLIBCXX_NOEXCEPT</a>
<a name="395"><span class="lineNum"> 395 </span> : : { return __x + __n; }</a>
<a name="396"><span class="lineNum"> 396 </span> : : </a>
<a name="397"><span class="lineNum"> 397 </span> : : template&lt;typename _Tp&gt;</a>
<a name="398"><span class="lineNum"> 398 </span> : : void</a>
<a name="399"><span class="lineNum"> 399 </span> : : fill(const _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;&amp;,</a>
<a name="400"><span class="lineNum"> 400 </span> : : const _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;&amp;, const _Tp&amp;);</a>
<a name="401"><span class="lineNum"> 401 </span> : : </a>
<a name="402"><span class="lineNum"> 402 </span> : : template&lt;typename _Tp&gt;</a>
<a name="403"><span class="lineNum"> 403 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;</a>
<a name="404"><span class="lineNum"> 404 </span> : : copy(_Deque_iterator&lt;_Tp, const _Tp&amp;, const _Tp*&gt;,</a>
<a name="405"><span class="lineNum"> 405 </span> : : _Deque_iterator&lt;_Tp, const _Tp&amp;, const _Tp*&gt;,</a>
<a name="406"><span class="lineNum"> 406 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;);</a>
<a name="407"><span class="lineNum"> 407 </span> : : </a>
<a name="408"><span class="lineNum"> 408 </span> : : template&lt;typename _Tp&gt;</a>
<a name="409"><span class="lineNum"> 409 </span> : : inline _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;</a>
<a name="410"><span class="lineNum"> 410 </span> : : copy(_Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt; __first,</a>
<a name="411"><span class="lineNum"> 411 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt; __last,</a>
<a name="412"><span class="lineNum"> 412 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt; __result)</a>
<a name="413"><span class="lineNum"> 413 </span> : : { return std::copy(_Deque_iterator&lt;_Tp, const _Tp&amp;, const _Tp*&gt;(__first),</a>
<a name="414"><span class="lineNum"> 414 </span> : : _Deque_iterator&lt;_Tp, const _Tp&amp;, const _Tp*&gt;(__last),</a>
<a name="415"><span class="lineNum"> 415 </span> : : __result); }</a>
<a name="416"><span class="lineNum"> 416 </span> : : </a>
<a name="417"><span class="lineNum"> 417 </span> : : template&lt;typename _Tp&gt;</a>
<a name="418"><span class="lineNum"> 418 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;</a>
<a name="419"><span class="lineNum"> 419 </span> : : copy_backward(_Deque_iterator&lt;_Tp, const _Tp&amp;, const _Tp*&gt;,</a>
<a name="420"><span class="lineNum"> 420 </span> : : _Deque_iterator&lt;_Tp, const _Tp&amp;, const _Tp*&gt;,</a>
<a name="421"><span class="lineNum"> 421 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;);</a>
<a name="422"><span class="lineNum"> 422 </span> : : </a>
<a name="423"><span class="lineNum"> 423 </span> : : template&lt;typename _Tp&gt;</a>
<a name="424"><span class="lineNum"> 424 </span> : : inline _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;</a>
<a name="425"><span class="lineNum"> 425 </span> : : copy_backward(_Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt; __first,</a>
<a name="426"><span class="lineNum"> 426 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt; __last,</a>
<a name="427"><span class="lineNum"> 427 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt; __result)</a>
<a name="428"><span class="lineNum"> 428 </span> : : { return std::copy_backward(_Deque_iterator&lt;_Tp,</a>
<a name="429"><span class="lineNum"> 429 </span> : : const _Tp&amp;, const _Tp*&gt;(__first),</a>
<a name="430"><span class="lineNum"> 430 </span> : : _Deque_iterator&lt;_Tp,</a>
<a name="431"><span class="lineNum"> 431 </span> : : const _Tp&amp;, const _Tp*&gt;(__last),</a>
<a name="432"><span class="lineNum"> 432 </span> : : __result); }</a>
<a name="433"><span class="lineNum"> 433 </span> : : </a>
<a name="434"><span class="lineNum"> 434 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="435"><span class="lineNum"> 435 </span> : : template&lt;typename _Tp&gt;</a>
<a name="436"><span class="lineNum"> 436 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;</a>
<a name="437"><span class="lineNum"> 437 </span> : : move(_Deque_iterator&lt;_Tp, const _Tp&amp;, const _Tp*&gt;,</a>
<a name="438"><span class="lineNum"> 438 </span> : : _Deque_iterator&lt;_Tp, const _Tp&amp;, const _Tp*&gt;,</a>
<a name="439"><span class="lineNum"> 439 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;);</a>
<a name="440"><span class="lineNum"> 440 </span> : : </a>
<a name="441"><span class="lineNum"> 441 </span> : : template&lt;typename _Tp&gt;</a>
<a name="442"><span class="lineNum"> 442 </span> : : inline _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;</a>
<a name="443"><span class="lineNum"> 443 </span> : : move(_Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt; __first,</a>
<a name="444"><span class="lineNum"> 444 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt; __last,</a>
<a name="445"><span class="lineNum"> 445 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt; __result)</a>
<a name="446"><span class="lineNum"> 446 </span> : : { return std::move(_Deque_iterator&lt;_Tp, const _Tp&amp;, const _Tp*&gt;(__first),</a>
<a name="447"><span class="lineNum"> 447 </span> : : _Deque_iterator&lt;_Tp, const _Tp&amp;, const _Tp*&gt;(__last),</a>
<a name="448"><span class="lineNum"> 448 </span> : : __result); }</a>
<a name="449"><span class="lineNum"> 449 </span> : : </a>
<a name="450"><span class="lineNum"> 450 </span> : : template&lt;typename _Tp&gt;</a>
<a name="451"><span class="lineNum"> 451 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;</a>
<a name="452"><span class="lineNum"> 452 </span> : : move_backward(_Deque_iterator&lt;_Tp, const _Tp&amp;, const _Tp*&gt;,</a>
<a name="453"><span class="lineNum"> 453 </span> : : _Deque_iterator&lt;_Tp, const _Tp&amp;, const _Tp*&gt;,</a>
<a name="454"><span class="lineNum"> 454 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;);</a>
<a name="455"><span class="lineNum"> 455 </span> : : </a>
<a name="456"><span class="lineNum"> 456 </span> : : template&lt;typename _Tp&gt;</a>
<a name="457"><span class="lineNum"> 457 </span> : : inline _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;</a>
<a name="458"><span class="lineNum"> 458 </span> : : move_backward(_Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt; __first,</a>
<a name="459"><span class="lineNum"> 459 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt; __last,</a>
<a name="460"><span class="lineNum"> 460 </span> : : _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt; __result)</a>
<a name="461"><span class="lineNum"> 461 </span> : : { return std::move_backward(_Deque_iterator&lt;_Tp,</a>
<a name="462"><span class="lineNum"> 462 </span> : : const _Tp&amp;, const _Tp*&gt;(__first),</a>
<a name="463"><span class="lineNum"> 463 </span> : : _Deque_iterator&lt;_Tp,</a>
<a name="464"><span class="lineNum"> 464 </span> : : const _Tp&amp;, const _Tp*&gt;(__last),</a>
<a name="465"><span class="lineNum"> 465 </span> : : __result); }</a>
<a name="466"><span class="lineNum"> 466 </span> : : #endif</a>
<a name="467"><span class="lineNum"> 467 </span> : : </a>
<a name="468"><span class="lineNum"> 468 </span> : : /**</a>
<a name="469"><span class="lineNum"> 469 </span> : : * Deque base class. This class provides the unified face for %deque's</a>
<a name="470"><span class="lineNum"> 470 </span> : : * allocation. This class's constructor and destructor allocate and</a>
<a name="471"><span class="lineNum"> 471 </span> : : * deallocate (but do not initialize) storage. This makes %exception</a>
<a name="472"><span class="lineNum"> 472 </span> : : * safety easier.</a>
<a name="473"><span class="lineNum"> 473 </span> : : *</a>
<a name="474"><span class="lineNum"> 474 </span> : : * Nothing in this class ever constructs or destroys an actual Tp element.</a>
<a name="475"><span class="lineNum"> 475 </span> : : * (Deque handles that itself.) Only/All memory management is performed</a>
<a name="476"><span class="lineNum"> 476 </span> : : * here.</a>
<a name="477"><span class="lineNum"> 477 </span> : : */</a>
<a name="478"><span class="lineNum"> 478 </span> : : template&lt;typename _Tp, typename _Alloc&gt;</a>
<a name="479"><span class="lineNum"> 479 </span> : : class _Deque_base</a>
<a name="480"><span class="lineNum"> 480 </span> : : {</a>
<a name="481"><span class="lineNum"> 481 </span> : : protected:</a>
<a name="482"><span class="lineNum"> 482 </span> : : typedef typename __gnu_cxx::__alloc_traits&lt;_Alloc&gt;::template</a>
<a name="483"><span class="lineNum"> 483 </span> : : rebind&lt;_Tp&gt;::other _Tp_alloc_type;</a>
<a name="484"><span class="lineNum"> 484 </span> : : typedef __gnu_cxx::__alloc_traits&lt;_Tp_alloc_type&gt; _Alloc_traits;</a>
<a name="485"><span class="lineNum"> 485 </span> : : </a>
<a name="486"><span class="lineNum"> 486 </span> : : #if __cplusplus &lt; 201103L</a>
<a name="487"><span class="lineNum"> 487 </span> : : typedef _Tp* _Ptr;</a>
<a name="488"><span class="lineNum"> 488 </span> : : typedef const _Tp* _Ptr_const;</a>
<a name="489"><span class="lineNum"> 489 </span> : : #else</a>
<a name="490"><span class="lineNum"> 490 </span> : : typedef typename _Alloc_traits::pointer _Ptr;</a>
<a name="491"><span class="lineNum"> 491 </span> : : typedef typename _Alloc_traits::const_pointer _Ptr_const;</a>
<a name="492"><span class="lineNum"> 492 </span> : : #endif</a>
<a name="493"><span class="lineNum"> 493 </span> : : </a>
<a name="494"><span class="lineNum"> 494 </span> : : typedef typename _Alloc_traits::template rebind&lt;_Ptr&gt;::other</a>
<a name="495"><span class="lineNum"> 495 </span> : : _Map_alloc_type;</a>
<a name="496"><span class="lineNum"> 496 </span> : : typedef __gnu_cxx::__alloc_traits&lt;_Map_alloc_type&gt; _Map_alloc_traits;</a>
<a name="497"><span class="lineNum"> 497 </span> : : </a>
<a name="498"><span class="lineNum"> 498 </span> : : public:</a>
<a name="499"><span class="lineNum"> 499 </span> : : typedef _Alloc allocator_type;</a>
<a name="500"><span class="lineNum"> 500 </span> : : </a>
<a name="501"><span class="lineNum"> 501 </span> : : allocator_type</a>
<a name="502"><span class="lineNum"> 502 </span> : : get_allocator() const _GLIBCXX_NOEXCEPT</a>
<a name="503"><span class="lineNum"> 503 </span> : : { return allocator_type(_M_get_Tp_allocator()); }</a>
<a name="504"><span class="lineNum"> 504 </span> : : </a>
<a name="505"><span class="lineNum"> 505 </span> : : typedef _Deque_iterator&lt;_Tp, _Tp&amp;, _Ptr&gt; iterator;</a>
<a name="506"><span class="lineNum"> 506 </span> : : typedef _Deque_iterator&lt;_Tp, const _Tp&amp;, _Ptr_const&gt; const_iterator;</a>
<a name="507"><span class="lineNum"> 507 </span> : : </a>
<a name="508"><span class="lineNum"> 508 </span> :<span class="lineCov"> 1 : _Deque_base()</span></a>
<a name="509"><span class="lineNum"> 509 </span> :<span class="lineCov"> 1 : : _M_impl()</span></a>
<a name="510"><span class="lineNum"> 510 </span> [<span class="branchCov" title="Branch 0 was taken 1 time"> + </span><span class="branchNoCov" title="Branch 1 was not taken"> - </span>]:<span class="lineCov"> 1 : { _M_initialize_map(0); }</span></a>
<a name="511"><span class="lineNum"> 511 </span> : : </a>
<a name="512"><span class="lineNum"> 512 </span> : : _Deque_base(size_t __num_elements)</a>
<a name="513"><span class="lineNum"> 513 </span> : : : _M_impl()</a>
<a name="514"><span class="lineNum"> 514 </span> : : { _M_initialize_map(__num_elements); }</a>
<a name="515"><span class="lineNum"> 515 </span> : : </a>
<a name="516"><span class="lineNum"> 516 </span> : : _Deque_base(const allocator_type&amp; __a, size_t __num_elements)</a>
<a name="517"><span class="lineNum"> 517 </span> : : : _M_impl(__a)</a>
<a name="518"><span class="lineNum"> 518 </span> : : { _M_initialize_map(__num_elements); }</a>
<a name="519"><span class="lineNum"> 519 </span> : : </a>
<a name="520"><span class="lineNum"> 520 </span> : : _Deque_base(const allocator_type&amp; __a)</a>
<a name="521"><span class="lineNum"> 521 </span> : : : _M_impl(__a)</a>
<a name="522"><span class="lineNum"> 522 </span> : : { /* Caller must initialize map. */ }</a>
<a name="523"><span class="lineNum"> 523 </span> : : </a>
<a name="524"><span class="lineNum"> 524 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="525"><span class="lineNum"> 525 </span> : : _Deque_base(_Deque_base&amp;&amp; __x, false_type)</a>
<a name="526"><span class="lineNum"> 526 </span> : : : _M_impl(__x._M_move_impl())</a>
<a name="527"><span class="lineNum"> 527 </span> : : { }</a>
<a name="528"><span class="lineNum"> 528 </span> : : </a>
<a name="529"><span class="lineNum"> 529 </span> : : _Deque_base(_Deque_base&amp;&amp; __x, true_type)</a>
<a name="530"><span class="lineNum"> 530 </span> : : : _M_impl(std::move(__x._M_get_Tp_allocator()))</a>
<a name="531"><span class="lineNum"> 531 </span> : : {</a>
<a name="532"><span class="lineNum"> 532 </span> : : _M_initialize_map(0);</a>
<a name="533"><span class="lineNum"> 533 </span> : : if (__x._M_impl._M_map)</a>
<a name="534"><span class="lineNum"> 534 </span> : : this-&gt;_M_impl._M_swap_data(__x._M_impl);</a>
<a name="535"><span class="lineNum"> 535 </span> : : }</a>
<a name="536"><span class="lineNum"> 536 </span> : : </a>
<a name="537"><span class="lineNum"> 537 </span> : : _Deque_base(_Deque_base&amp;&amp; __x)</a>
<a name="538"><span class="lineNum"> 538 </span> : : : _Deque_base(std::move(__x), typename _Alloc_traits::is_always_equal{})</a>
<a name="539"><span class="lineNum"> 539 </span> : : { }</a>
<a name="540"><span class="lineNum"> 540 </span> : : </a>
<a name="541"><span class="lineNum"> 541 </span> : : _Deque_base(_Deque_base&amp;&amp; __x, const allocator_type&amp; __a, size_t __n)</a>
<a name="542"><span class="lineNum"> 542 </span> : : : _M_impl(__a)</a>
<a name="543"><span class="lineNum"> 543 </span> : : {</a>
<a name="544"><span class="lineNum"> 544 </span> : : if (__x.get_allocator() == __a)</a>
<a name="545"><span class="lineNum"> 545 </span> : : {</a>
<a name="546"><span class="lineNum"> 546 </span> : : if (__x._M_impl._M_map)</a>
<a name="547"><span class="lineNum"> 547 </span> : : {</a>
<a name="548"><span class="lineNum"> 548 </span> : : _M_initialize_map(0);</a>
<a name="549"><span class="lineNum"> 549 </span> : : this-&gt;_M_impl._M_swap_data(__x._M_impl);</a>
<a name="550"><span class="lineNum"> 550 </span> : : }</a>
<a name="551"><span class="lineNum"> 551 </span> : : }</a>
<a name="552"><span class="lineNum"> 552 </span> : : else</a>
<a name="553"><span class="lineNum"> 553 </span> : : {</a>
<a name="554"><span class="lineNum"> 554 </span> : : _M_initialize_map(__n);</a>
<a name="555"><span class="lineNum"> 555 </span> : : }</a>
<a name="556"><span class="lineNum"> 556 </span> : : }</a>
<a name="557"><span class="lineNum"> 557 </span> : : #endif</a>
<a name="558"><span class="lineNum"> 558 </span> : : </a>
<a name="559"><span class="lineNum"> 559 </span> : : ~_Deque_base() _GLIBCXX_NOEXCEPT;</a>
<a name="560"><span class="lineNum"> 560 </span> : : </a>
<a name="561"><span class="lineNum"> 561 </span> : : protected:</a>
<a name="562"><span class="lineNum"> 562 </span> : : typedef typename iterator::_Map_pointer _Map_pointer;</a>
<a name="563"><span class="lineNum"> 563 </span> : : </a>
<a name="564"><span class="lineNum"> 564 </span> : : //This struct encapsulates the implementation of the std::deque</a>
<a name="565"><span class="lineNum"> 565 </span> : : //standard container and at the same time makes use of the EBO</a>
<a name="566"><span class="lineNum"> 566 </span> : : //for empty allocators.</a>
<a name="567"><span class="lineNum"> 567 </span> : : struct _Deque_impl</a>
<a name="568"><span class="lineNum"> 568 </span> : : : public _Tp_alloc_type</a>
<a name="569"><span class="lineNum"> 569 </span> : : {</a>
<a name="570"><span class="lineNum"> 570 </span> : : _Map_pointer _M_map;</a>
<a name="571"><span class="lineNum"> 571 </span> : : size_t _M_map_size;</a>
<a name="572"><span class="lineNum"> 572 </span> : : iterator _M_start;</a>
<a name="573"><span class="lineNum"> 573 </span> : : iterator _M_finish;</a>
<a name="574"><span class="lineNum"> 574 </span> : : </a>
<a name="575"><span class="lineNum"> 575 </span> :<span class="lineCov"> 1 : _Deque_impl()</span></a>
<a name="576"><span class="lineNum"> 576 </span> : : : _Tp_alloc_type(), _M_map(), _M_map_size(0),</a>
<a name="577"><span class="lineNum"> 577 </span> :<span class="lineCov"> 1 : _M_start(), _M_finish()</span></a>
<a name="578"><span class="lineNum"> 578 </span> :<span class="lineCov"> 1 : { }</span></a>
<a name="579"><span class="lineNum"> 579 </span> : : </a>
<a name="580"><span class="lineNum"> 580 </span> : : _Deque_impl(const _Tp_alloc_type&amp; __a) _GLIBCXX_NOEXCEPT</a>
<a name="581"><span class="lineNum"> 581 </span> : : : _Tp_alloc_type(__a), _M_map(), _M_map_size(0),</a>
<a name="582"><span class="lineNum"> 582 </span> : : _M_start(), _M_finish()</a>
<a name="583"><span class="lineNum"> 583 </span> : : { }</a>
<a name="584"><span class="lineNum"> 584 </span> : : </a>
<a name="585"><span class="lineNum"> 585 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="586"><span class="lineNum"> 586 </span> : : _Deque_impl(_Deque_impl&amp;&amp;) = default;</a>
<a name="587"><span class="lineNum"> 587 </span> : : </a>
<a name="588"><span class="lineNum"> 588 </span> : : _Deque_impl(_Tp_alloc_type&amp;&amp; __a) noexcept</a>
<a name="589"><span class="lineNum"> 589 </span> : : : _Tp_alloc_type(std::move(__a)), _M_map(), _M_map_size(0),</a>
<a name="590"><span class="lineNum"> 590 </span> : : _M_start(), _M_finish()</a>
<a name="591"><span class="lineNum"> 591 </span> : : { }</a>
<a name="592"><span class="lineNum"> 592 </span> : : #endif</a>
<a name="593"><span class="lineNum"> 593 </span> : : </a>
<a name="594"><span class="lineNum"> 594 </span> : : void _M_swap_data(_Deque_impl&amp; __x) _GLIBCXX_NOEXCEPT</a>
<a name="595"><span class="lineNum"> 595 </span> : : {</a>
<a name="596"><span class="lineNum"> 596 </span> : : using std::swap;</a>
<a name="597"><span class="lineNum"> 597 </span> : : swap(this-&gt;_M_start, __x._M_start);</a>
<a name="598"><span class="lineNum"> 598 </span> : : swap(this-&gt;_M_finish, __x._M_finish);</a>
<a name="599"><span class="lineNum"> 599 </span> : : swap(this-&gt;_M_map, __x._M_map);</a>
<a name="600"><span class="lineNum"> 600 </span> : : swap(this-&gt;_M_map_size, __x._M_map_size);</a>
<a name="601"><span class="lineNum"> 601 </span> : : }</a>
<a name="602"><span class="lineNum"> 602 </span> : : };</a>
<a name="603"><span class="lineNum"> 603 </span> : : </a>
<a name="604"><span class="lineNum"> 604 </span> : : _Tp_alloc_type&amp;</a>
<a name="605"><span class="lineNum"> 605 </span> :<span class="lineCov"> 1 : _M_get_Tp_allocator() _GLIBCXX_NOEXCEPT</span></a>
<a name="606"><span class="lineNum"> 606 </span> :<span class="lineCov"> 1 : { return *static_cast&lt;_Tp_alloc_type*&gt;(&amp;this-&gt;_M_impl); }</span></a>
<a name="607"><span class="lineNum"> 607 </span> : : </a>
<a name="608"><span class="lineNum"> 608 </span> : : const _Tp_alloc_type&amp;</a>
<a name="609"><span class="lineNum"> 609 </span> :<span class="lineCov"> 2 : _M_get_Tp_allocator() const _GLIBCXX_NOEXCEPT</span></a>
<a name="610"><span class="lineNum"> 610 </span> :<span class="lineCov"> 2 : { return *static_cast&lt;const _Tp_alloc_type*&gt;(&amp;this-&gt;_M_impl); }</span></a>
<a name="611"><span class="lineNum"> 611 </span> : : </a>
<a name="612"><span class="lineNum"> 612 </span> : : _Map_alloc_type</a>
<a name="613"><span class="lineNum"> 613 </span> :<span class="lineCov"> 2 : _M_get_map_allocator() const _GLIBCXX_NOEXCEPT</span></a>
<a name="614"><span class="lineNum"> 614 </span> :<span class="lineCov"> 2 : { return _Map_alloc_type(_M_get_Tp_allocator()); }</span></a>
<a name="615"><span class="lineNum"> 615 </span> : : </a>
<a name="616"><span class="lineNum"> 616 </span> : : _Ptr</a>
<a name="617"><span class="lineNum"> 617 </span> :<span class="lineCov"> 1 : _M_allocate_node()</span></a>
<a name="618"><span class="lineNum"> 618 </span> : : {</a>
<a name="619"><span class="lineNum"> 619 </span> : : typedef __gnu_cxx::__alloc_traits&lt;_Tp_alloc_type&gt; _Traits;</a>
<a name="620"><span class="lineNum"> 620 </span> :<span class="lineCov"> 1 : return _Traits::allocate(_M_impl, __deque_buf_size(sizeof(_Tp)));</span></a>
<a name="621"><span class="lineNum"> 621 </span> : : }</a>
<a name="622"><span class="lineNum"> 622 </span> : : </a>
<a name="623"><span class="lineNum"> 623 </span> : : void</a>
<a name="624"><span class="lineNum"> 624 </span> :<span class="lineCov"> 1 : _M_deallocate_node(_Ptr __p) _GLIBCXX_NOEXCEPT</span></a>
<a name="625"><span class="lineNum"> 625 </span> : : {</a>
<a name="626"><span class="lineNum"> 626 </span> : : typedef __gnu_cxx::__alloc_traits&lt;_Tp_alloc_type&gt; _Traits;</a>
<a name="627"><span class="lineNum"> 627 </span> :<span class="lineCov"> 1 : _Traits::deallocate(_M_impl, __p, __deque_buf_size(sizeof(_Tp)));</span></a>
<a name="628"><span class="lineNum"> 628 </span> :<span class="lineCov"> 1 : }</span></a>
<a name="629"><span class="lineNum"> 629 </span> : : </a>
<a name="630"><span class="lineNum"> 630 </span> : : _Map_pointer</a>
<a name="631"><span class="lineNum"> 631 </span> :<span class="lineCov"> 1 : _M_allocate_map(size_t __n)</span></a>
<a name="632"><span class="lineNum"> 632 </span> : : {</a>
<a name="633"><span class="lineNum"> 633 </span> :<span class="lineCov"> 2 : _Map_alloc_type __map_alloc = _M_get_map_allocator();</span></a>
<a name="634"><span class="lineNum"> 634 </span> [<span class="branchCov" title="Branch 0 was taken 1 time"> + </span><span class="branchNoCov" title="Branch 1 was not taken"> - </span>]:<span class="lineCov"> 2 : return _Map_alloc_traits::allocate(__map_alloc, __n);</span></a>
<a name="635"><span class="lineNum"> 635 </span> : : }</a>
<a name="636"><span class="lineNum"> 636 </span> : : </a>
<a name="637"><span class="lineNum"> 637 </span> : : void</a>
<a name="638"><span class="lineNum"> 638 </span> :<span class="lineCov"> 1 : _M_deallocate_map(_Map_pointer __p, size_t __n) _GLIBCXX_NOEXCEPT</span></a>
<a name="639"><span class="lineNum"> 639 </span> : : {</a>
<a name="640"><span class="lineNum"> 640 </span> :<span class="lineCov"> 2 : _Map_alloc_type __map_alloc = _M_get_map_allocator();</span></a>
<a name="641"><span class="lineNum"> 641 </span> :<span class="lineCov"> 1 : _Map_alloc_traits::deallocate(__map_alloc, __p, __n);</span></a>
<a name="642"><span class="lineNum"> 642 </span> :<span class="lineCov"> 1 : }</span></a>
<a name="643"><span class="lineNum"> 643 </span> : : </a>
<a name="644"><span class="lineNum"> 644 </span> : : protected:</a>
<a name="645"><span class="lineNum"> 645 </span> : : void _M_initialize_map(size_t);</a>
<a name="646"><span class="lineNum"> 646 </span> : : void _M_create_nodes(_Map_pointer __nstart, _Map_pointer __nfinish);</a>
<a name="647"><span class="lineNum"> 647 </span> : : void _M_destroy_nodes(_Map_pointer __nstart,</a>
<a name="648"><span class="lineNum"> 648 </span> : : _Map_pointer __nfinish) _GLIBCXX_NOEXCEPT;</a>
<a name="649"><span class="lineNum"> 649 </span> : : enum { _S_initial_map_size = 8 };</a>
<a name="650"><span class="lineNum"> 650 </span> : : </a>
<a name="651"><span class="lineNum"> 651 </span> : : _Deque_impl _M_impl;</a>
<a name="652"><span class="lineNum"> 652 </span> : : </a>
<a name="653"><span class="lineNum"> 653 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="654"><span class="lineNum"> 654 </span> : : private:</a>
<a name="655"><span class="lineNum"> 655 </span> : : _Deque_impl</a>
<a name="656"><span class="lineNum"> 656 </span> : : _M_move_impl()</a>
<a name="657"><span class="lineNum"> 657 </span> : : {</a>
<a name="658"><span class="lineNum"> 658 </span> : : if (!_M_impl._M_map)</a>
<a name="659"><span class="lineNum"> 659 </span> : : return std::move(_M_impl);</a>
<a name="660"><span class="lineNum"> 660 </span> : : </a>
<a name="661"><span class="lineNum"> 661 </span> : : // Create a copy of the current allocator.</a>
<a name="662"><span class="lineNum"> 662 </span> : : _Tp_alloc_type __alloc{_M_get_Tp_allocator()};</a>
<a name="663"><span class="lineNum"> 663 </span> : : // Put that copy in a moved-from state.</a>
<a name="664"><span class="lineNum"> 664 </span> : : _Tp_alloc_type __sink __attribute((__unused__)) {std::move(__alloc)};</a>
<a name="665"><span class="lineNum"> 665 </span> : : // Create an empty map that allocates using the moved-from allocator.</a>
<a name="666"><span class="lineNum"> 666 </span> : : _Deque_base __empty{__alloc};</a>
<a name="667"><span class="lineNum"> 667 </span> : : __empty._M_initialize_map(0);</a>
<a name="668"><span class="lineNum"> 668 </span> : : // Now safe to modify current allocator and perform non-throwing swaps.</a>
<a name="669"><span class="lineNum"> 669 </span> : : _Deque_impl __ret{std::move(_M_get_Tp_allocator())};</a>
<a name="670"><span class="lineNum"> 670 </span> : : _M_impl._M_swap_data(__ret);</a>
<a name="671"><span class="lineNum"> 671 </span> : : _M_impl._M_swap_data(__empty._M_impl);</a>
<a name="672"><span class="lineNum"> 672 </span> : : return __ret;</a>
<a name="673"><span class="lineNum"> 673 </span> : : }</a>
<a name="674"><span class="lineNum"> 674 </span> : : #endif</a>
<a name="675"><span class="lineNum"> 675 </span> : : };</a>
<a name="676"><span class="lineNum"> 676 </span> : : </a>
<a name="677"><span class="lineNum"> 677 </span> : : template&lt;typename _Tp, typename _Alloc&gt;</a>
<a name="678"><span class="lineNum"> 678 </span> :<span class="lineCov"> 1 : _Deque_base&lt;_Tp, _Alloc&gt;::</span></a>
<a name="679"><span class="lineNum"> 679 </span> : : ~_Deque_base() _GLIBCXX_NOEXCEPT</a>
<a name="680"><span class="lineNum"> 680 </span> : : {</a>
<a name="681"><span class="lineNum"> 681 </span> [<span class="branchCov" title="Branch 0 was taken 1 time"> + </span><span class="branchNoCov" title="Branch 1 was not taken"> - </span>]:<span class="lineCov"> 1 : if (this-&gt;_M_impl._M_map)</span></a>
<a name="682"><span class="lineNum"> 682 </span> : : {</a>
<a name="683"><span class="lineNum"> 683 </span> :<span class="lineCov"> 1 : _M_destroy_nodes(this-&gt;_M_impl._M_start._M_node,</span></a>
<a name="684"><span class="lineNum"> 684 </span> :<span class="lineCov"> 1 : this-&gt;_M_impl._M_finish._M_node + 1);</span></a>
<a name="685"><span class="lineNum"> 685 </span> :<span class="lineCov"> 1 : _M_deallocate_map(this-&gt;_M_impl._M_map, this-&gt;_M_impl._M_map_size);</span></a>
<a name="686"><span class="lineNum"> 686 </span> : : }</a>
<a name="687"><span class="lineNum"> 687 </span> :<span class="lineCov"> 1 : }</span></a>
<a name="688"><span class="lineNum"> 688 </span> : : </a>
<a name="689"><span class="lineNum"> 689 </span> : : /**</a>
<a name="690"><span class="lineNum"> 690 </span> : : * @brief Layout storage.</a>
<a name="691"><span class="lineNum"> 691 </span> : : * @param __num_elements The count of T's for which to allocate space</a>
<a name="692"><span class="lineNum"> 692 </span> : : * at first.</a>
<a name="693"><span class="lineNum"> 693 </span> : : * @return Nothing.</a>
<a name="694"><span class="lineNum"> 694 </span> : : *</a>
<a name="695"><span class="lineNum"> 695 </span> : : * The initial underlying memory layout is a bit complicated...</a>
<a name="696"><span class="lineNum"> 696 </span> : : */</a>
<a name="697"><span class="lineNum"> 697 </span> : : template&lt;typename _Tp, typename _Alloc&gt;</a>
<a name="698"><span class="lineNum"> 698 </span> : : void</a>
<a name="699"><span class="lineNum"> 699 </span> :<span class="lineCov"> 1 : _Deque_base&lt;_Tp, _Alloc&gt;::</span></a>
<a name="700"><span class="lineNum"> 700 </span> : : _M_initialize_map(size_t __num_elements)</a>
<a name="701"><span class="lineNum"> 701 </span> : : {</a>
<a name="702"><span class="lineNum"> 702 </span> :<span class="lineCov"> 1 : const size_t __num_nodes = (__num_elements/ __deque_buf_size(sizeof(_Tp))</span></a>
<a name="703"><span class="lineNum"> 703 </span> : : + 1);</a>
<a name="704"><span class="lineNum"> 704 </span> : : </a>
<a name="705"><span class="lineNum"> 705 </span> :<span class="lineCov"> 2 : this-&gt;_M_impl._M_map_size = std::max((size_t) _S_initial_map_size,</span></a>
<a name="706"><span class="lineNum"> 706 </span> :<span class="lineCov"> 1 : size_t(__num_nodes + 2));</span></a>
<a name="707"><span class="lineNum"> 707 </span> :<span class="lineCov"> 1 : this-&gt;_M_impl._M_map = _M_allocate_map(this-&gt;_M_impl._M_map_size);</span></a>
<a name="708"><span class="lineNum"> 708 </span> : : </a>
<a name="709"><span class="lineNum"> 709 </span> : : // For &quot;small&quot; maps (needing less than _M_map_size nodes), allocation</a>
<a name="710"><span class="lineNum"> 710 </span> : : // starts in the middle elements and grows outwards. So nstart may be</a>
<a name="711"><span class="lineNum"> 711 </span> : : // the beginning of _M_map, but for small maps it may be as far in as</a>
<a name="712"><span class="lineNum"> 712 </span> : : // _M_map+3.</a>
<a name="713"><span class="lineNum"> 713 </span> : : </a>
<a name="714"><span class="lineNum"> 714 </span> :<span class="lineCov"> 1 : _Map_pointer __nstart = (this-&gt;_M_impl._M_map</span></a>
<a name="715"><span class="lineNum"> 715 </span> :<span class="lineCov"> 1 : + (this-&gt;_M_impl._M_map_size - __num_nodes) / 2);</span></a>
<a name="716"><span class="lineNum"> 716 </span> :<span class="lineCov"> 1 : _Map_pointer __nfinish = __nstart + __num_nodes;</span></a>
<a name="717"><span class="lineNum"> 717 </span> : : </a>
<a name="718"><span class="lineNum"> 718 </span> : : __try</a>
<a name="719"><span class="lineNum"> 719 </span> [<span class="branchCov" title="Branch 0 was taken 1 time"> + </span><span class="branchNoCov" title="Branch 1 was not taken"> - </span>]:<span class="lineCov"> 1 : { _M_create_nodes(__nstart, __nfinish); }</span></a>
<a name="720"><span class="lineNum"> 720 </span> :<span class="lineNoCov"> 0 : __catch(...)</span></a>
<a name="721"><span class="lineNum"> 721 </span> : : {</a>
<a name="722"><span class="lineNum"> 722 </span> :<span class="lineNoCov"> 0 : _M_deallocate_map(this-&gt;_M_impl._M_map, this-&gt;_M_impl._M_map_size);</span></a>
<a name="723"><span class="lineNum"> 723 </span> :<span class="lineNoCov"> 0 : this-&gt;_M_impl._M_map = _Map_pointer();</span></a>
<a name="724"><span class="lineNum"> 724 </span> :<span class="lineNoCov"> 0 : this-&gt;_M_impl._M_map_size = 0;</span></a>
<a name="725"><span class="lineNum"> 725 </span> :<span class="lineNoCov"> 0 : __throw_exception_again;</span></a>
<a name="726"><span class="lineNum"> 726 </span> : : }</a>
<a name="727"><span class="lineNum"> 727 </span> : : </a>
<a name="728"><span class="lineNum"> 728 </span> :<span class="lineCov"> 1 : this-&gt;_M_impl._M_start._M_set_node(__nstart);</span></a>
<a name="729"><span class="lineNum"> 729 </span> :<span class="lineCov"> 1 : this-&gt;_M_impl._M_finish._M_set_node(__nfinish - 1);</span></a>
<a name="730"><span class="lineNum"> 730 </span> :<span class="lineCov"> 1 : this-&gt;_M_impl._M_start._M_cur = _M_impl._M_start._M_first;</span></a>
<a name="731"><span class="lineNum"> 731 </span> :<span class="lineCov"> 2 : this-&gt;_M_impl._M_finish._M_cur = (this-&gt;_M_impl._M_finish._M_first</span></a>
<a name="732"><span class="lineNum"> 732 </span> :<span class="lineCov"> 1 : + __num_elements</span></a>
<a name="733"><span class="lineNum"> 733 </span> :<span class="lineCov"> 1 : % __deque_buf_size(sizeof(_Tp)));</span></a>
<a name="734"><span class="lineNum"> 734 </span> :<span class="lineCov"> 1 : }</span></a>
<a name="735"><span class="lineNum"> 735 </span> : : </a>
<a name="736"><span class="lineNum"> 736 </span> : : template&lt;typename _Tp, typename _Alloc&gt;</a>
<a name="737"><span class="lineNum"> 737 </span> : : void</a>
<a name="738"><span class="lineNum"> 738 </span> :<span class="lineCov"> 1 : _Deque_base&lt;_Tp, _Alloc&gt;::</span></a>
<a name="739"><span class="lineNum"> 739 </span> : : _M_create_nodes(_Map_pointer __nstart, _Map_pointer __nfinish)</a>
<a name="740"><span class="lineNum"> 740 </span> : : {</a>
<a name="741"><span class="lineNum"> 741 </span> : : _Map_pointer __cur;</a>
<a name="742"><span class="lineNum"> 742 </span> : : __try</a>
<a name="743"><span class="lineNum"> 743 </span> : : {</a>
<a name="744"><span class="lineNum"> 744 </span> [<span class="branchCov" title="Branch 0 was taken 1 time"> + </span><span class="branchCov" title="Branch 1 was taken 1 time"> + </span>]:<span class="lineCov"> 2 : for (__cur = __nstart; __cur &lt; __nfinish; ++__cur)</span></a>
<a name="745"><span class="lineNum"> 745 </span> [<span class="branchCov" title="Branch 0 was taken 1 time"> + </span><span class="branchNoCov" title="Branch 1 was not taken"> - </span>]:<span class="lineCov"> 1 : *__cur = this-&gt;_M_allocate_node();</span></a>
<a name="746"><span class="lineNum"> 746 </span> : : }</a>
<a name="747"><span class="lineNum"> 747 </span> :<span class="lineNoCov"> 0 : __catch(...)</span></a>
<a name="748"><span class="lineNum"> 748 </span> : : {</a>
<a name="749"><span class="lineNum"> 749 </span> :<span class="lineNoCov"> 0 : _M_destroy_nodes(__nstart, __cur);</span></a>
<a name="750"><span class="lineNum"> 750 </span> :<span class="lineNoCov"> 0 : __throw_exception_again;</span></a>
<a name="751"><span class="lineNum"> 751 </span> : : }</a>
<a name="752"><span class="lineNum"> 752 </span> :<span class="lineCov"> 1 : }</span></a>
<a name="753"><span class="lineNum"> 753 </span> : : </a>
<a name="754"><span class="lineNum"> 754 </span> : : template&lt;typename _Tp, typename _Alloc&gt;</a>
<a name="755"><span class="lineNum"> 755 </span> : : void</a>
<a name="756"><span class="lineNum"> 756 </span> :<span class="lineCov"> 1 : _Deque_base&lt;_Tp, _Alloc&gt;::</span></a>
<a name="757"><span class="lineNum"> 757 </span> : : _M_destroy_nodes(_Map_pointer __nstart,</a>
<a name="758"><span class="lineNum"> 758 </span> : : _Map_pointer __nfinish) _GLIBCXX_NOEXCEPT</a>
<a name="759"><span class="lineNum"> 759 </span> : : {</a>
<a name="760"><span class="lineNum"> 760 </span> [<span class="branchCov" title="Branch 0 was taken 1 time"> + </span><span class="branchCov" title="Branch 1 was taken 1 time"> + </span>]:<span class="lineCov"> 2 : for (_Map_pointer __n = __nstart; __n &lt; __nfinish; ++__n)</span></a>
<a name="761"><span class="lineNum"> 761 </span> :<span class="lineCov"> 1 : _M_deallocate_node(*__n);</span></a>
<a name="762"><span class="lineNum"> 762 </span> :<span class="lineCov"> 1 : }</span></a>
<a name="763"><span class="lineNum"> 763 </span> : : </a>
<a name="764"><span class="lineNum"> 764 </span> : : /**</a>
<a name="765"><span class="lineNum"> 765 </span> : : * @brief A standard container using fixed-size memory allocation and</a>
<a name="766"><span class="lineNum"> 766 </span> : : * constant-time manipulation of elements at either end.</a>
<a name="767"><span class="lineNum"> 767 </span> : : *</a>
<a name="768"><span class="lineNum"> 768 </span> : : * @ingroup sequences</a>
<a name="769"><span class="lineNum"> 769 </span> : : *</a>
<a name="770"><span class="lineNum"> 770 </span> : : * @tparam _Tp Type of element.</a>
<a name="771"><span class="lineNum"> 771 </span> : : * @tparam _Alloc Allocator type, defaults to allocator&lt;_Tp&gt;.</a>
<a name="772"><span class="lineNum"> 772 </span> : : *</a>
<a name="773"><span class="lineNum"> 773 </span> : : * Meets the requirements of a &lt;a href=&quot;tables.html#65&quot;&gt;container&lt;/a&gt;, a</a>
<a name="774"><span class="lineNum"> 774 </span> : : * &lt;a href=&quot;tables.html#66&quot;&gt;reversible container&lt;/a&gt;, and a</a>
<a name="775"><span class="lineNum"> 775 </span> : : * &lt;a href=&quot;tables.html#67&quot;&gt;sequence&lt;/a&gt;, including the</a>
<a name="776"><span class="lineNum"> 776 </span> : : * &lt;a href=&quot;tables.html#68&quot;&gt;optional sequence requirements&lt;/a&gt;.</a>
<a name="777"><span class="lineNum"> 777 </span> : : *</a>
<a name="778"><span class="lineNum"> 778 </span> : : * In previous HP/SGI versions of deque, there was an extra template</a>
<a name="779"><span class="lineNum"> 779 </span> : : * parameter so users could control the node size. This extension turned</a>
<a name="780"><span class="lineNum"> 780 </span> : : * out to violate the C++ standard (it can be detected using template</a>
<a name="781"><span class="lineNum"> 781 </span> : : * template parameters), and it was removed.</a>
<a name="782"><span class="lineNum"> 782 </span> : : *</a>
<a name="783"><span class="lineNum"> 783 </span> : : * Here's how a deque&lt;Tp&gt; manages memory. Each deque has 4 members:</a>
<a name="784"><span class="lineNum"> 784 </span> : : *</a>
<a name="785"><span class="lineNum"> 785 </span> : : * - Tp** _M_map</a>
<a name="786"><span class="lineNum"> 786 </span> : : * - size_t _M_map_size</a>
<a name="787"><span class="lineNum"> 787 </span> : : * - iterator _M_start, _M_finish</a>
<a name="788"><span class="lineNum"> 788 </span> : : *</a>
<a name="789"><span class="lineNum"> 789 </span> : : * map_size is at least 8. %map is an array of map_size</a>
<a name="790"><span class="lineNum"> 790 </span> : : * pointers-to-@a nodes. (The name %map has nothing to do with the</a>
<a name="791"><span class="lineNum"> 791 </span> : : * std::map class, and @b nodes should not be confused with</a>
<a name="792"><span class="lineNum"> 792 </span> : : * std::list's usage of @a node.)</a>
<a name="793"><span class="lineNum"> 793 </span> : : *</a>
<a name="794"><span class="lineNum"> 794 </span> : : * A @a node has no specific type name as such, but it is referred</a>
<a name="795"><span class="lineNum"> 795 </span> : : * to as @a node in this file. It is a simple array-of-Tp. If Tp</a>
<a name="796"><span class="lineNum"> 796 </span> : : * is very large, there will be one Tp element per node (i.e., an</a>
<a name="797"><span class="lineNum"> 797 </span> : : * @a array of one). For non-huge Tp's, node size is inversely</a>
<a name="798"><span class="lineNum"> 798 </span> : : * related to Tp size: the larger the Tp, the fewer Tp's will fit</a>
<a name="799"><span class="lineNum"> 799 </span> : : * in a node. The goal here is to keep the total size of a node</a>
<a name="800"><span class="lineNum"> 800 </span> : : * relatively small and constant over different Tp's, to improve</a>
<a name="801"><span class="lineNum"> 801 </span> : : * allocator efficiency.</a>
<a name="802"><span class="lineNum"> 802 </span> : : *</a>
<a name="803"><span class="lineNum"> 803 </span> : : * Not every pointer in the %map array will point to a node. If</a>
<a name="804"><span class="lineNum"> 804 </span> : : * the initial number of elements in the deque is small, the</a>
<a name="805"><span class="lineNum"> 805 </span> : : * /middle/ %map pointers will be valid, and the ones at the edges</a>
<a name="806"><span class="lineNum"> 806 </span> : : * will be unused. This same situation will arise as the %map</a>
<a name="807"><span class="lineNum"> 807 </span> : : * grows: available %map pointers, if any, will be on the ends. As</a>
<a name="808"><span class="lineNum"> 808 </span> : : * new nodes are created, only a subset of the %map's pointers need</a>
<a name="809"><span class="lineNum"> 809 </span> : : * to be copied @a outward.</a>
<a name="810"><span class="lineNum"> 810 </span> : : *</a>
<a name="811"><span class="lineNum"> 811 </span> : : * Class invariants:</a>
<a name="812"><span class="lineNum"> 812 </span> : : * - For any nonsingular iterator i:</a>
<a name="813"><span class="lineNum"> 813 </span> : : * - i.node points to a member of the %map array. (Yes, you read that</a>
<a name="814"><span class="lineNum"> 814 </span> : : * correctly: i.node does not actually point to a node.) The member of</a>
<a name="815"><span class="lineNum"> 815 </span> : : * the %map array is what actually points to the node.</a>
<a name="816"><span class="lineNum"> 816 </span> : : * - i.first == *(i.node) (This points to the node (first Tp element).)</a>
<a name="817"><span class="lineNum"> 817 </span> : : * - i.last == i.first + node_size</a>
<a name="818"><span class="lineNum"> 818 </span> : : * - i.cur is a pointer in the range [i.first, i.last). NOTE:</a>
<a name="819"><span class="lineNum"> 819 </span> : : * the implication of this is that i.cur is always a dereferenceable</a>
<a name="820"><span class="lineNum"> 820 </span> : : * pointer, even if i is a past-the-end iterator.</a>
<a name="821"><span class="lineNum"> 821 </span> : : * - Start and Finish are always nonsingular iterators. NOTE: this</a>
<a name="822"><span class="lineNum"> 822 </span> : : * means that an empty deque must have one node, a deque with &lt;N</a>
<a name="823"><span class="lineNum"> 823 </span> : : * elements (where N is the node buffer size) must have one node, a</a>
<a name="824"><span class="lineNum"> 824 </span> : : * deque with N through (2N-1) elements must have two nodes, etc.</a>
<a name="825"><span class="lineNum"> 825 </span> : : * - For every node other than start.node and finish.node, every</a>
<a name="826"><span class="lineNum"> 826 </span> : : * element in the node is an initialized object. If start.node ==</a>
<a name="827"><span class="lineNum"> 827 </span> : : * finish.node, then [start.cur, finish.cur) are initialized</a>
<a name="828"><span class="lineNum"> 828 </span> : : * objects, and the elements outside that range are uninitialized</a>
<a name="829"><span class="lineNum"> 829 </span> : : * storage. Otherwise, [start.cur, start.last) and [finish.first,</a>
<a name="830"><span class="lineNum"> 830 </span> : : * finish.cur) are initialized objects, and [start.first, start.cur)</a>
<a name="831"><span class="lineNum"> 831 </span> : : * and [finish.cur, finish.last) are uninitialized storage.</a>
<a name="832"><span class="lineNum"> 832 </span> : : * - [%map, %map + map_size) is a valid, non-empty range.</a>
<a name="833"><span class="lineNum"> 833 </span> : : * - [start.node, finish.node] is a valid range contained within</a>
<a name="834"><span class="lineNum"> 834 </span> : : * [%map, %map + map_size).</a>
<a name="835"><span class="lineNum"> 835 </span> : : * - A pointer in the range [%map, %map + map_size) points to an allocated</a>
<a name="836"><span class="lineNum"> 836 </span> : : * node if and only if the pointer is in the range</a>
<a name="837"><span class="lineNum"> 837 </span> : : * [start.node, finish.node].</a>
<a name="838"><span class="lineNum"> 838 </span> : : *</a>
<a name="839"><span class="lineNum"> 839 </span> : : * Here's the magic: nothing in deque is @b aware of the discontiguous</a>
<a name="840"><span class="lineNum"> 840 </span> : : * storage!</a>
<a name="841"><span class="lineNum"> 841 </span> : : *</a>
<a name="842"><span class="lineNum"> 842 </span> : : * The memory setup and layout occurs in the parent, _Base, and the iterator</a>
<a name="843"><span class="lineNum"> 843 </span> : : * class is entirely responsible for @a leaping from one node to the next.</a>
<a name="844"><span class="lineNum"> 844 </span> : : * All the implementation routines for deque itself work only through the</a>
<a name="845"><span class="lineNum"> 845 </span> : : * start and finish iterators. This keeps the routines simple and sane,</a>
<a name="846"><span class="lineNum"> 846 </span> : : * and we can use other standard algorithms as well.</a>
<a name="847"><span class="lineNum"> 847 </span> : : */</a>
<a name="848"><span class="lineNum"> 848 </span> : : template&lt;typename _Tp, typename _Alloc = std::allocator&lt;_Tp&gt; &gt;</a>
<a name="849"><span class="lineNum"> 849 </span> : : class deque : protected _Deque_base&lt;_Tp, _Alloc&gt;</a>
<a name="850"><span class="lineNum"> 850 </span> : : {</a>
<a name="851"><span class="lineNum"> 851 </span> : : #ifdef _GLIBCXX_CONCEPT_CHECKS</a>
<a name="852"><span class="lineNum"> 852 </span> : : // concept requirements</a>
<a name="853"><span class="lineNum"> 853 </span> : : typedef typename _Alloc::value_type _Alloc_value_type;</a>
<a name="854"><span class="lineNum"> 854 </span> : : # if __cplusplus &lt; 201103L</a>
<a name="855"><span class="lineNum"> 855 </span> : : __glibcxx_class_requires(_Tp, _SGIAssignableConcept)</a>
<a name="856"><span class="lineNum"> 856 </span> : : # endif</a>
<a name="857"><span class="lineNum"> 857 </span> : : __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)</a>
<a name="858"><span class="lineNum"> 858 </span> : : #endif</a>
<a name="859"><span class="lineNum"> 859 </span> : : </a>
<a name="860"><span class="lineNum"> 860 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="861"><span class="lineNum"> 861 </span> : : static_assert(is_same&lt;typename remove_cv&lt;_Tp&gt;::type, _Tp&gt;::value,</a>
<a name="862"><span class="lineNum"> 862 </span> : : &quot;std::deque must have a non-const, non-volatile value_type&quot;);</a>
<a name="863"><span class="lineNum"> 863 </span> : : # ifdef __STRICT_ANSI__</a>
<a name="864"><span class="lineNum"> 864 </span> : : static_assert(is_same&lt;typename _Alloc::value_type, _Tp&gt;::value,</a>
<a name="865"><span class="lineNum"> 865 </span> : : &quot;std::deque must have the same value_type as its allocator&quot;);</a>
<a name="866"><span class="lineNum"> 866 </span> : : # endif</a>
<a name="867"><span class="lineNum"> 867 </span> : : #endif</a>
<a name="868"><span class="lineNum"> 868 </span> : : </a>
<a name="869"><span class="lineNum"> 869 </span> : : typedef _Deque_base&lt;_Tp, _Alloc&gt; _Base;</a>
<a name="870"><span class="lineNum"> 870 </span> : : typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;</a>
<a name="871"><span class="lineNum"> 871 </span> : : typedef typename _Base::_Alloc_traits _Alloc_traits;</a>
<a name="872"><span class="lineNum"> 872 </span> : : typedef typename _Base::_Map_pointer _Map_pointer;</a>
<a name="873"><span class="lineNum"> 873 </span> : : </a>
<a name="874"><span class="lineNum"> 874 </span> : : public:</a>
<a name="875"><span class="lineNum"> 875 </span> : : typedef _Tp value_type;</a>
<a name="876"><span class="lineNum"> 876 </span> : : typedef typename _Alloc_traits::pointer pointer;</a>
<a name="877"><span class="lineNum"> 877 </span> : : typedef typename _Alloc_traits::const_pointer const_pointer;</a>
<a name="878"><span class="lineNum"> 878 </span> : : typedef typename _Alloc_traits::reference reference;</a>
<a name="879"><span class="lineNum"> 879 </span> : : typedef typename _Alloc_traits::const_reference const_reference;</a>
<a name="880"><span class="lineNum"> 880 </span> : : typedef typename _Base::iterator iterator;</a>
<a name="881"><span class="lineNum"> 881 </span> : : typedef typename _Base::const_iterator const_iterator;</a>
<a name="882"><span class="lineNum"> 882 </span> : : typedef std::reverse_iterator&lt;const_iterator&gt; const_reverse_iterator;</a>
<a name="883"><span class="lineNum"> 883 </span> : : typedef std::reverse_iterator&lt;iterator&gt; reverse_iterator;</a>
<a name="884"><span class="lineNum"> 884 </span> : : typedef size_t size_type;</a>
<a name="885"><span class="lineNum"> 885 </span> : : typedef ptrdiff_t difference_type;</a>
<a name="886"><span class="lineNum"> 886 </span> : : typedef _Alloc allocator_type;</a>
<a name="887"><span class="lineNum"> 887 </span> : : </a>
<a name="888"><span class="lineNum"> 888 </span> : : protected:</a>
<a name="889"><span class="lineNum"> 889 </span> : : static size_t _S_buffer_size() _GLIBCXX_NOEXCEPT</a>
<a name="890"><span class="lineNum"> 890 </span> : : { return __deque_buf_size(sizeof(_Tp)); }</a>
<a name="891"><span class="lineNum"> 891 </span> : : </a>
<a name="892"><span class="lineNum"> 892 </span> : : // Functions controlling memory layout, and nothing else.</a>
<a name="893"><span class="lineNum"> 893 </span> : : using _Base::_M_initialize_map;</a>
<a name="894"><span class="lineNum"> 894 </span> : : using _Base::_M_create_nodes;</a>
<a name="895"><span class="lineNum"> 895 </span> : : using _Base::_M_destroy_nodes;</a>
<a name="896"><span class="lineNum"> 896 </span> : : using _Base::_M_allocate_node;</a>
<a name="897"><span class="lineNum"> 897 </span> : : using _Base::_M_deallocate_node;</a>
<a name="898"><span class="lineNum"> 898 </span> : : using _Base::_M_allocate_map;</a>
<a name="899"><span class="lineNum"> 899 </span> : : using _Base::_M_deallocate_map;</a>
<a name="900"><span class="lineNum"> 900 </span> : : using _Base::_M_get_Tp_allocator;</a>
<a name="901"><span class="lineNum"> 901 </span> : : </a>
<a name="902"><span class="lineNum"> 902 </span> : : /**</a>
<a name="903"><span class="lineNum"> 903 </span> : : * A total of four data members accumulated down the hierarchy.</a>
<a name="904"><span class="lineNum"> 904 </span> : : * May be accessed via _M_impl.*</a>
<a name="905"><span class="lineNum"> 905 </span> : : */</a>
<a name="906"><span class="lineNum"> 906 </span> : : using _Base::_M_impl;</a>
<a name="907"><span class="lineNum"> 907 </span> : : </a>
<a name="908"><span class="lineNum"> 908 </span> : : public:</a>
<a name="909"><span class="lineNum"> 909 </span> : : // [23.2.1.1] construct/copy/destroy</a>
<a name="910"><span class="lineNum"> 910 </span> : : // (assign() and get_allocator() are also listed in this section)</a>
<a name="911"><span class="lineNum"> 911 </span> : : </a>
<a name="912"><span class="lineNum"> 912 </span> : : /**</a>
<a name="913"><span class="lineNum"> 913 </span> : : * @brief Creates a %deque with no elements.</a>
<a name="914"><span class="lineNum"> 914 </span> : : */</a>
<a name="915"><span class="lineNum"> 915 </span> :<span class="lineCov"> 1 : deque() : _Base() { }</span></a>
<a name="916"><span class="lineNum"> 916 </span> : : </a>
<a name="917"><span class="lineNum"> 917 </span> : : /**</a>
<a name="918"><span class="lineNum"> 918 </span> : : * @brief Creates a %deque with no elements.</a>
<a name="919"><span class="lineNum"> 919 </span> : : * @param __a An allocator object.</a>
<a name="920"><span class="lineNum"> 920 </span> : : */</a>
<a name="921"><span class="lineNum"> 921 </span> : : explicit</a>
<a name="922"><span class="lineNum"> 922 </span> : : deque(const allocator_type&amp; __a)</a>
<a name="923"><span class="lineNum"> 923 </span> : : : _Base(__a, 0) { }</a>
<a name="924"><span class="lineNum"> 924 </span> : : </a>
<a name="925"><span class="lineNum"> 925 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="926"><span class="lineNum"> 926 </span> : : /**</a>
<a name="927"><span class="lineNum"> 927 </span> : : * @brief Creates a %deque with default constructed elements.</a>
<a name="928"><span class="lineNum"> 928 </span> : : * @param __n The number of elements to initially create.</a>
<a name="929"><span class="lineNum"> 929 </span> : : * @param __a An allocator.</a>
<a name="930"><span class="lineNum"> 930 </span> : : *</a>
<a name="931"><span class="lineNum"> 931 </span> : : * This constructor fills the %deque with @a n default</a>
<a name="932"><span class="lineNum"> 932 </span> : : * constructed elements.</a>
<a name="933"><span class="lineNum"> 933 </span> : : */</a>
<a name="934"><span class="lineNum"> 934 </span> : : explicit</a>
<a name="935"><span class="lineNum"> 935 </span> : : deque(size_type __n, const allocator_type&amp; __a = allocator_type())</a>
<a name="936"><span class="lineNum"> 936 </span> : : : _Base(__a, _S_check_init_len(__n, __a))</a>
<a name="937"><span class="lineNum"> 937 </span> : : { _M_default_initialize(); }</a>
<a name="938"><span class="lineNum"> 938 </span> : : </a>
<a name="939"><span class="lineNum"> 939 </span> : : /**</a>
<a name="940"><span class="lineNum"> 940 </span> : : * @brief Creates a %deque with copies of an exemplar element.</a>
<a name="941"><span class="lineNum"> 941 </span> : : * @param __n The number of elements to initially create.</a>
<a name="942"><span class="lineNum"> 942 </span> : : * @param __value An element to copy.</a>
<a name="943"><span class="lineNum"> 943 </span> : : * @param __a An allocator.</a>
<a name="944"><span class="lineNum"> 944 </span> : : *</a>
<a name="945"><span class="lineNum"> 945 </span> : : * This constructor fills the %deque with @a __n copies of @a __value.</a>
<a name="946"><span class="lineNum"> 946 </span> : : */</a>
<a name="947"><span class="lineNum"> 947 </span> : : deque(size_type __n, const value_type&amp; __value,</a>
<a name="948"><span class="lineNum"> 948 </span> : : const allocator_type&amp; __a = allocator_type())</a>
<a name="949"><span class="lineNum"> 949 </span> : : : _Base(__a, _S_check_init_len(__n, __a))</a>
<a name="950"><span class="lineNum"> 950 </span> : : { _M_fill_initialize(__value); }</a>
<a name="951"><span class="lineNum"> 951 </span> : : #else</a>
<a name="952"><span class="lineNum"> 952 </span> : : /**</a>
<a name="953"><span class="lineNum"> 953 </span> : : * @brief Creates a %deque with copies of an exemplar element.</a>
<a name="954"><span class="lineNum"> 954 </span> : : * @param __n The number of elements to initially create.</a>
<a name="955"><span class="lineNum"> 955 </span> : : * @param __value An element to copy.</a>
<a name="956"><span class="lineNum"> 956 </span> : : * @param __a An allocator.</a>
<a name="957"><span class="lineNum"> 957 </span> : : *</a>
<a name="958"><span class="lineNum"> 958 </span> : : * This constructor fills the %deque with @a __n copies of @a __value.</a>
<a name="959"><span class="lineNum"> 959 </span> : : */</a>
<a name="960"><span class="lineNum"> 960 </span> : : explicit</a>
<a name="961"><span class="lineNum"> 961 </span> : : deque(size_type __n, const value_type&amp; __value = value_type(),</a>
<a name="962"><span class="lineNum"> 962 </span> : : const allocator_type&amp; __a = allocator_type())</a>
<a name="963"><span class="lineNum"> 963 </span> : : : _Base(__a, _S_check_init_len(__n, __a))</a>
<a name="964"><span class="lineNum"> 964 </span> : : { _M_fill_initialize(__value); }</a>
<a name="965"><span class="lineNum"> 965 </span> : : #endif</a>
<a name="966"><span class="lineNum"> 966 </span> : : </a>
<a name="967"><span class="lineNum"> 967 </span> : : /**</a>
<a name="968"><span class="lineNum"> 968 </span> : : * @brief %Deque copy constructor.</a>
<a name="969"><span class="lineNum"> 969 </span> : : * @param __x A %deque of identical element and allocator types.</a>
<a name="970"><span class="lineNum"> 970 </span> : : *</a>
<a name="971"><span class="lineNum"> 971 </span> : : * The newly-created %deque uses a copy of the allocator object used</a>
<a name="972"><span class="lineNum"> 972 </span> : : * by @a __x (unless the allocator traits dictate a different object).</a>
<a name="973"><span class="lineNum"> 973 </span> : : */</a>
<a name="974"><span class="lineNum"> 974 </span> : : deque(const deque&amp; __x)</a>
<a name="975"><span class="lineNum"> 975 </span> : : : _Base(_Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator()),</a>
<a name="976"><span class="lineNum"> 976 </span> : : __x.size())</a>
<a name="977"><span class="lineNum"> 977 </span> : : { std::__uninitialized_copy_a(__x.begin(), __x.end(),</a>
<a name="978"><span class="lineNum"> 978 </span> : : this-&gt;_M_impl._M_start,</a>
<a name="979"><span class="lineNum"> 979 </span> : : _M_get_Tp_allocator()); }</a>
<a name="980"><span class="lineNum"> 980 </span> : : </a>
<a name="981"><span class="lineNum"> 981 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="982"><span class="lineNum"> 982 </span> : : /**</a>
<a name="983"><span class="lineNum"> 983 </span> : : * @brief %Deque move constructor.</a>
<a name="984"><span class="lineNum"> 984 </span> : : * @param __x A %deque of identical element and allocator types.</a>
<a name="985"><span class="lineNum"> 985 </span> : : *</a>
<a name="986"><span class="lineNum"> 986 </span> : : * The newly-created %deque contains the exact contents of @a __x.</a>
<a name="987"><span class="lineNum"> 987 </span> : : * The contents of @a __x are a valid, but unspecified %deque.</a>
<a name="988"><span class="lineNum"> 988 </span> : : */</a>
<a name="989"><span class="lineNum"> 989 </span> : : deque(deque&amp;&amp; __x)</a>
<a name="990"><span class="lineNum"> 990 </span> : : : _Base(std::move(__x)) { }</a>
<a name="991"><span class="lineNum"> 991 </span> : : </a>
<a name="992"><span class="lineNum"> 992 </span> : : /// Copy constructor with alternative allocator</a>
<a name="993"><span class="lineNum"> 993 </span> : : deque(const deque&amp; __x, const allocator_type&amp; __a)</a>
<a name="994"><span class="lineNum"> 994 </span> : : : _Base(__a, __x.size())</a>
<a name="995"><span class="lineNum"> 995 </span> : : { std::__uninitialized_copy_a(__x.begin(), __x.end(),</a>
<a name="996"><span class="lineNum"> 996 </span> : : this-&gt;_M_impl._M_start,</a>
<a name="997"><span class="lineNum"> 997 </span> : : _M_get_Tp_allocator()); }</a>
<a name="998"><span class="lineNum"> 998 </span> : : </a>
<a name="999"><span class="lineNum"> 999 </span> : : /// Move constructor with alternative allocator</a>
<a name="1000"><span class="lineNum"> 1000 </span> : : deque(deque&amp;&amp; __x, const allocator_type&amp; __a)</a>
<a name="1001"><span class="lineNum"> 1001 </span> : : : _Base(std::move(__x), __a, __x.size())</a>
<a name="1002"><span class="lineNum"> 1002 </span> : : {</a>
<a name="1003"><span class="lineNum"> 1003 </span> : : if (__x.get_allocator() != __a)</a>
<a name="1004"><span class="lineNum"> 1004 </span> : : {</a>
<a name="1005"><span class="lineNum"> 1005 </span> : : std::__uninitialized_move_a(__x.begin(), __x.end(),</a>
<a name="1006"><span class="lineNum"> 1006 </span> : : this-&gt;_M_impl._M_start,</a>
<a name="1007"><span class="lineNum"> 1007 </span> : : _M_get_Tp_allocator());</a>
<a name="1008"><span class="lineNum"> 1008 </span> : : __x.clear();</a>
<a name="1009"><span class="lineNum"> 1009 </span> : : }</a>
<a name="1010"><span class="lineNum"> 1010 </span> : : }</a>
<a name="1011"><span class="lineNum"> 1011 </span> : : </a>
<a name="1012"><span class="lineNum"> 1012 </span> : : /**</a>
<a name="1013"><span class="lineNum"> 1013 </span> : : * @brief Builds a %deque from an initializer list.</a>
<a name="1014"><span class="lineNum"> 1014 </span> : : * @param __l An initializer_list.</a>
<a name="1015"><span class="lineNum"> 1015 </span> : : * @param __a An allocator object.</a>
<a name="1016"><span class="lineNum"> 1016 </span> : : *</a>
<a name="1017"><span class="lineNum"> 1017 </span> : : * Create a %deque consisting of copies of the elements in the</a>
<a name="1018"><span class="lineNum"> 1018 </span> : : * initializer_list @a __l.</a>
<a name="1019"><span class="lineNum"> 1019 </span> : : *</a>
<a name="1020"><span class="lineNum"> 1020 </span> : : * This will call the element type's copy constructor N times</a>
<a name="1021"><span class="lineNum"> 1021 </span> : : * (where N is __l.size()) and do no memory reallocation.</a>
<a name="1022"><span class="lineNum"> 1022 </span> : : */</a>
<a name="1023"><span class="lineNum"> 1023 </span> : : deque(initializer_list&lt;value_type&gt; __l,</a>
<a name="1024"><span class="lineNum"> 1024 </span> : : const allocator_type&amp; __a = allocator_type())</a>
<a name="1025"><span class="lineNum"> 1025 </span> : : : _Base(__a)</a>
<a name="1026"><span class="lineNum"> 1026 </span> : : {</a>
<a name="1027"><span class="lineNum"> 1027 </span> : : _M_range_initialize(__l.begin(), __l.end(),</a>
<a name="1028"><span class="lineNum"> 1028 </span> : : random_access_iterator_tag());</a>
<a name="1029"><span class="lineNum"> 1029 </span> : : }</a>
<a name="1030"><span class="lineNum"> 1030 </span> : : #endif</a>
<a name="1031"><span class="lineNum"> 1031 </span> : : </a>
<a name="1032"><span class="lineNum"> 1032 </span> : : /**</a>
<a name="1033"><span class="lineNum"> 1033 </span> : : * @brief Builds a %deque from a range.</a>
<a name="1034"><span class="lineNum"> 1034 </span> : : * @param __first An input iterator.</a>
<a name="1035"><span class="lineNum"> 1035 </span> : : * @param __last An input iterator.</a>
<a name="1036"><span class="lineNum"> 1036 </span> : : * @param __a An allocator object.</a>
<a name="1037"><span class="lineNum"> 1037 </span> : : *</a>
<a name="1038"><span class="lineNum"> 1038 </span> : : * Create a %deque consisting of copies of the elements from [__first,</a>
<a name="1039"><span class="lineNum"> 1039 </span> : : * __last).</a>
<a name="1040"><span class="lineNum"> 1040 </span> : : *</a>
<a name="1041"><span class="lineNum"> 1041 </span> : : * If the iterators are forward, bidirectional, or random-access, then</a>
<a name="1042"><span class="lineNum"> 1042 </span> : : * this will call the elements' copy constructor N times (where N is</a>
<a name="1043"><span class="lineNum"> 1043 </span> : : * distance(__first,__last)) and do no memory reallocation. But if only</a>
<a name="1044"><span class="lineNum"> 1044 </span> : : * input iterators are used, then this will do at most 2N calls to the</a>
<a name="1045"><span class="lineNum"> 1045 </span> : : * copy constructor, and logN memory reallocations.</a>
<a name="1046"><span class="lineNum"> 1046 </span> : : */</a>
<a name="1047"><span class="lineNum"> 1047 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1048"><span class="lineNum"> 1048 </span> : : template&lt;typename _InputIterator,</a>
<a name="1049"><span class="lineNum"> 1049 </span> : : typename = std::_RequireInputIter&lt;_InputIterator&gt;&gt;</a>
<a name="1050"><span class="lineNum"> 1050 </span> : : deque(_InputIterator __first, _InputIterator __last,</a>
<a name="1051"><span class="lineNum"> 1051 </span> : : const allocator_type&amp; __a = allocator_type())</a>
<a name="1052"><span class="lineNum"> 1052 </span> : : : _Base(__a)</a>
<a name="1053"><span class="lineNum"> 1053 </span> : : { _M_initialize_dispatch(__first, __last, __false_type()); }</a>
<a name="1054"><span class="lineNum"> 1054 </span> : : #else</a>
<a name="1055"><span class="lineNum"> 1055 </span> : : template&lt;typename _InputIterator&gt;</a>
<a name="1056"><span class="lineNum"> 1056 </span> : : deque(_InputIterator __first, _InputIterator __last,</a>
<a name="1057"><span class="lineNum"> 1057 </span> : : const allocator_type&amp; __a = allocator_type())</a>
<a name="1058"><span class="lineNum"> 1058 </span> : : : _Base(__a)</a>
<a name="1059"><span class="lineNum"> 1059 </span> : : {</a>
<a name="1060"><span class="lineNum"> 1060 </span> : : // Check whether it's an integral type. If so, it's not an iterator.</a>
<a name="1061"><span class="lineNum"> 1061 </span> : : typedef typename std::__is_integer&lt;_InputIterator&gt;::__type _Integral;</a>
<a name="1062"><span class="lineNum"> 1062 </span> : : _M_initialize_dispatch(__first, __last, _Integral());</a>
<a name="1063"><span class="lineNum"> 1063 </span> : : }</a>
<a name="1064"><span class="lineNum"> 1064 </span> : : #endif</a>
<a name="1065"><span class="lineNum"> 1065 </span> : : </a>
<a name="1066"><span class="lineNum"> 1066 </span> : : /**</a>
<a name="1067"><span class="lineNum"> 1067 </span> : : * The dtor only erases the elements, and note that if the elements</a>
<a name="1068"><span class="lineNum"> 1068 </span> : : * themselves are pointers, the pointed-to memory is not touched in any</a>
<a name="1069"><span class="lineNum"> 1069 </span> : : * way. Managing the pointer is the user's responsibility.</a>
<a name="1070"><span class="lineNum"> 1070 </span> : : */</a>
<a name="1071"><span class="lineNum"> 1071 </span> :<span class="lineCov"> 1 : ~deque()</span></a>
<a name="1072"><span class="lineNum"> 1072 </span> :<span class="lineCov"> 1 : { _M_destroy_data(begin(), end(), _M_get_Tp_allocator()); }</span></a>
<a name="1073"><span class="lineNum"> 1073 </span> : : </a>
<a name="1074"><span class="lineNum"> 1074 </span> : : /**</a>
<a name="1075"><span class="lineNum"> 1075 </span> : : * @brief %Deque assignment operator.</a>
<a name="1076"><span class="lineNum"> 1076 </span> : : * @param __x A %deque of identical element and allocator types.</a>
<a name="1077"><span class="lineNum"> 1077 </span> : : *</a>
<a name="1078"><span class="lineNum"> 1078 </span> : : * All the elements of @a x are copied.</a>
<a name="1079"><span class="lineNum"> 1079 </span> : : *</a>
<a name="1080"><span class="lineNum"> 1080 </span> : : * The newly-created %deque uses a copy of the allocator object used</a>
<a name="1081"><span class="lineNum"> 1081 </span> : : * by @a __x (unless the allocator traits dictate a different object).</a>
<a name="1082"><span class="lineNum"> 1082 </span> : : */</a>
<a name="1083"><span class="lineNum"> 1083 </span> : : deque&amp;</a>
<a name="1084"><span class="lineNum"> 1084 </span> : : operator=(const deque&amp; __x);</a>
<a name="1085"><span class="lineNum"> 1085 </span> : : </a>
<a name="1086"><span class="lineNum"> 1086 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1087"><span class="lineNum"> 1087 </span> : : /**</a>
<a name="1088"><span class="lineNum"> 1088 </span> : : * @brief %Deque move assignment operator.</a>
<a name="1089"><span class="lineNum"> 1089 </span> : : * @param __x A %deque of identical element and allocator types.</a>
<a name="1090"><span class="lineNum"> 1090 </span> : : *</a>
<a name="1091"><span class="lineNum"> 1091 </span> : : * The contents of @a __x are moved into this deque (without copying,</a>
<a name="1092"><span class="lineNum"> 1092 </span> : : * if the allocators permit it).</a>
<a name="1093"><span class="lineNum"> 1093 </span> : : * @a __x is a valid, but unspecified %deque.</a>
<a name="1094"><span class="lineNum"> 1094 </span> : : */</a>
<a name="1095"><span class="lineNum"> 1095 </span> : : deque&amp;</a>
<a name="1096"><span class="lineNum"> 1096 </span> : : operator=(deque&amp;&amp; __x) noexcept(_Alloc_traits::_S_always_equal())</a>
<a name="1097"><span class="lineNum"> 1097 </span> : : {</a>
<a name="1098"><span class="lineNum"> 1098 </span> : : using __always_equal = typename _Alloc_traits::is_always_equal;</a>
<a name="1099"><span class="lineNum"> 1099 </span> : : _M_move_assign1(std::move(__x), __always_equal{});</a>
<a name="1100"><span class="lineNum"> 1100 </span> : : return *this;</a>
<a name="1101"><span class="lineNum"> 1101 </span> : : }</a>
<a name="1102"><span class="lineNum"> 1102 </span> : : </a>
<a name="1103"><span class="lineNum"> 1103 </span> : : /**</a>
<a name="1104"><span class="lineNum"> 1104 </span> : : * @brief Assigns an initializer list to a %deque.</a>
<a name="1105"><span class="lineNum"> 1105 </span> : : * @param __l An initializer_list.</a>
<a name="1106"><span class="lineNum"> 1106 </span> : : *</a>
<a name="1107"><span class="lineNum"> 1107 </span> : : * This function fills a %deque with copies of the elements in the</a>
<a name="1108"><span class="lineNum"> 1108 </span> : : * initializer_list @a __l.</a>
<a name="1109"><span class="lineNum"> 1109 </span> : : *</a>
<a name="1110"><span class="lineNum"> 1110 </span> : : * Note that the assignment completely changes the %deque and that the</a>
<a name="1111"><span class="lineNum"> 1111 </span> : : * resulting %deque's size is the same as the number of elements</a>
<a name="1112"><span class="lineNum"> 1112 </span> : : * assigned.</a>
<a name="1113"><span class="lineNum"> 1113 </span> : : */</a>
<a name="1114"><span class="lineNum"> 1114 </span> : : deque&amp;</a>
<a name="1115"><span class="lineNum"> 1115 </span> : : operator=(initializer_list&lt;value_type&gt; __l)</a>
<a name="1116"><span class="lineNum"> 1116 </span> : : {</a>
<a name="1117"><span class="lineNum"> 1117 </span> : : _M_assign_aux(__l.begin(), __l.end(),</a>
<a name="1118"><span class="lineNum"> 1118 </span> : : random_access_iterator_tag());</a>
<a name="1119"><span class="lineNum"> 1119 </span> : : return *this;</a>
<a name="1120"><span class="lineNum"> 1120 </span> : : }</a>
<a name="1121"><span class="lineNum"> 1121 </span> : : #endif</a>
<a name="1122"><span class="lineNum"> 1122 </span> : : </a>
<a name="1123"><span class="lineNum"> 1123 </span> : : /**</a>
<a name="1124"><span class="lineNum"> 1124 </span> : : * @brief Assigns a given value to a %deque.</a>
<a name="1125"><span class="lineNum"> 1125 </span> : : * @param __n Number of elements to be assigned.</a>
<a name="1126"><span class="lineNum"> 1126 </span> : : * @param __val Value to be assigned.</a>
<a name="1127"><span class="lineNum"> 1127 </span> : : *</a>
<a name="1128"><span class="lineNum"> 1128 </span> : : * This function fills a %deque with @a n copies of the given</a>
<a name="1129"><span class="lineNum"> 1129 </span> : : * value. Note that the assignment completely changes the</a>
<a name="1130"><span class="lineNum"> 1130 </span> : : * %deque and that the resulting %deque's size is the same as</a>
<a name="1131"><span class="lineNum"> 1131 </span> : : * the number of elements assigned.</a>
<a name="1132"><span class="lineNum"> 1132 </span> : : */</a>
<a name="1133"><span class="lineNum"> 1133 </span> : : void</a>
<a name="1134"><span class="lineNum"> 1134 </span> : : assign(size_type __n, const value_type&amp; __val)</a>
<a name="1135"><span class="lineNum"> 1135 </span> : : { _M_fill_assign(__n, __val); }</a>
<a name="1136"><span class="lineNum"> 1136 </span> : : </a>
<a name="1137"><span class="lineNum"> 1137 </span> : : /**</a>
<a name="1138"><span class="lineNum"> 1138 </span> : : * @brief Assigns a range to a %deque.</a>
<a name="1139"><span class="lineNum"> 1139 </span> : : * @param __first An input iterator.</a>
<a name="1140"><span class="lineNum"> 1140 </span> : : * @param __last An input iterator.</a>
<a name="1141"><span class="lineNum"> 1141 </span> : : *</a>
<a name="1142"><span class="lineNum"> 1142 </span> : : * This function fills a %deque with copies of the elements in the</a>
<a name="1143"><span class="lineNum"> 1143 </span> : : * range [__first,__last).</a>
<a name="1144"><span class="lineNum"> 1144 </span> : : *</a>
<a name="1145"><span class="lineNum"> 1145 </span> : : * Note that the assignment completely changes the %deque and that the</a>
<a name="1146"><span class="lineNum"> 1146 </span> : : * resulting %deque's size is the same as the number of elements</a>
<a name="1147"><span class="lineNum"> 1147 </span> : : * assigned.</a>
<a name="1148"><span class="lineNum"> 1148 </span> : : */</a>
<a name="1149"><span class="lineNum"> 1149 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1150"><span class="lineNum"> 1150 </span> : : template&lt;typename _InputIterator,</a>
<a name="1151"><span class="lineNum"> 1151 </span> : : typename = std::_RequireInputIter&lt;_InputIterator&gt;&gt;</a>
<a name="1152"><span class="lineNum"> 1152 </span> : : void</a>
<a name="1153"><span class="lineNum"> 1153 </span> : : assign(_InputIterator __first, _InputIterator __last)</a>
<a name="1154"><span class="lineNum"> 1154 </span> : : { _M_assign_dispatch(__first, __last, __false_type()); }</a>
<a name="1155"><span class="lineNum"> 1155 </span> : : #else</a>
<a name="1156"><span class="lineNum"> 1156 </span> : : template&lt;typename _InputIterator&gt;</a>
<a name="1157"><span class="lineNum"> 1157 </span> : : void</a>
<a name="1158"><span class="lineNum"> 1158 </span> : : assign(_InputIterator __first, _InputIterator __last)</a>
<a name="1159"><span class="lineNum"> 1159 </span> : : {</a>
<a name="1160"><span class="lineNum"> 1160 </span> : : typedef typename std::__is_integer&lt;_InputIterator&gt;::__type _Integral;</a>
<a name="1161"><span class="lineNum"> 1161 </span> : : _M_assign_dispatch(__first, __last, _Integral());</a>
<a name="1162"><span class="lineNum"> 1162 </span> : : }</a>
<a name="1163"><span class="lineNum"> 1163 </span> : : #endif</a>
<a name="1164"><span class="lineNum"> 1164 </span> : : </a>
<a name="1165"><span class="lineNum"> 1165 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1166"><span class="lineNum"> 1166 </span> : : /**</a>
<a name="1167"><span class="lineNum"> 1167 </span> : : * @brief Assigns an initializer list to a %deque.</a>
<a name="1168"><span class="lineNum"> 1168 </span> : : * @param __l An initializer_list.</a>
<a name="1169"><span class="lineNum"> 1169 </span> : : *</a>
<a name="1170"><span class="lineNum"> 1170 </span> : : * This function fills a %deque with copies of the elements in the</a>
<a name="1171"><span class="lineNum"> 1171 </span> : : * initializer_list @a __l.</a>
<a name="1172"><span class="lineNum"> 1172 </span> : : *</a>
<a name="1173"><span class="lineNum"> 1173 </span> : : * Note that the assignment completely changes the %deque and that the</a>
<a name="1174"><span class="lineNum"> 1174 </span> : : * resulting %deque's size is the same as the number of elements</a>
<a name="1175"><span class="lineNum"> 1175 </span> : : * assigned.</a>
<a name="1176"><span class="lineNum"> 1176 </span> : : */</a>
<a name="1177"><span class="lineNum"> 1177 </span> : : void</a>
<a name="1178"><span class="lineNum"> 1178 </span> : : assign(initializer_list&lt;value_type&gt; __l)</a>
<a name="1179"><span class="lineNum"> 1179 </span> : : { _M_assign_aux(__l.begin(), __l.end(), random_access_iterator_tag()); }</a>
<a name="1180"><span class="lineNum"> 1180 </span> : : #endif</a>
<a name="1181"><span class="lineNum"> 1181 </span> : : </a>
<a name="1182"><span class="lineNum"> 1182 </span> : : /// Get a copy of the memory allocation object.</a>
<a name="1183"><span class="lineNum"> 1183 </span> : : allocator_type</a>
<a name="1184"><span class="lineNum"> 1184 </span> : : get_allocator() const _GLIBCXX_NOEXCEPT</a>
<a name="1185"><span class="lineNum"> 1185 </span> : : { return _Base::get_allocator(); }</a>
<a name="1186"><span class="lineNum"> 1186 </span> : : </a>
<a name="1187"><span class="lineNum"> 1187 </span> : : // iterators</a>
<a name="1188"><span class="lineNum"> 1188 </span> : : /**</a>
<a name="1189"><span class="lineNum"> 1189 </span> : : * Returns a read/write iterator that points to the first element in the</a>
<a name="1190"><span class="lineNum"> 1190 </span> : : * %deque. Iteration is done in ordinary element order.</a>
<a name="1191"><span class="lineNum"> 1191 </span> : : */</a>
<a name="1192"><span class="lineNum"> 1192 </span> : : iterator</a>
<a name="1193"><span class="lineNum"> 1193 </span> :<span class="lineCov"> 1 : begin() _GLIBCXX_NOEXCEPT</span></a>
<a name="1194"><span class="lineNum"> 1194 </span> :<span class="lineCov"> 1 : { return this-&gt;_M_impl._M_start; }</span></a>
<a name="1195"><span class="lineNum"> 1195 </span> : : </a>
<a name="1196"><span class="lineNum"> 1196 </span> : : /**</a>
<a name="1197"><span class="lineNum"> 1197 </span> : : * Returns a read-only (constant) iterator that points to the first</a>
<a name="1198"><span class="lineNum"> 1198 </span> : : * element in the %deque. Iteration is done in ordinary element order.</a>
<a name="1199"><span class="lineNum"> 1199 </span> : : */</a>
<a name="1200"><span class="lineNum"> 1200 </span> : : const_iterator</a>
<a name="1201"><span class="lineNum"> 1201 </span> : : begin() const _GLIBCXX_NOEXCEPT</a>
<a name="1202"><span class="lineNum"> 1202 </span> : : { return this-&gt;_M_impl._M_start; }</a>
<a name="1203"><span class="lineNum"> 1203 </span> : : </a>
<a name="1204"><span class="lineNum"> 1204 </span> : : /**</a>
<a name="1205"><span class="lineNum"> 1205 </span> : : * Returns a read/write iterator that points one past the last</a>
<a name="1206"><span class="lineNum"> 1206 </span> : : * element in the %deque. Iteration is done in ordinary</a>
<a name="1207"><span class="lineNum"> 1207 </span> : : * element order.</a>
<a name="1208"><span class="lineNum"> 1208 </span> : : */</a>
<a name="1209"><span class="lineNum"> 1209 </span> : : iterator</a>
<a name="1210"><span class="lineNum"> 1210 </span> :<span class="lineCov"> 4 : end() _GLIBCXX_NOEXCEPT</span></a>
<a name="1211"><span class="lineNum"> 1211 </span> :<span class="lineCov"> 4 : { return this-&gt;_M_impl._M_finish; }</span></a>
<a name="1212"><span class="lineNum"> 1212 </span> : : </a>
<a name="1213"><span class="lineNum"> 1213 </span> : : /**</a>
<a name="1214"><span class="lineNum"> 1214 </span> : : * Returns a read-only (constant) iterator that points one past</a>
<a name="1215"><span class="lineNum"> 1215 </span> : : * the last element in the %deque. Iteration is done in</a>
<a name="1216"><span class="lineNum"> 1216 </span> : : * ordinary element order.</a>
<a name="1217"><span class="lineNum"> 1217 </span> : : */</a>
<a name="1218"><span class="lineNum"> 1218 </span> : : const_iterator</a>
<a name="1219"><span class="lineNum"> 1219 </span> : : end() const _GLIBCXX_NOEXCEPT</a>
<a name="1220"><span class="lineNum"> 1220 </span> : : { return this-&gt;_M_impl._M_finish; }</a>
<a name="1221"><span class="lineNum"> 1221 </span> : : </a>
<a name="1222"><span class="lineNum"> 1222 </span> : : /**</a>
<a name="1223"><span class="lineNum"> 1223 </span> : : * Returns a read/write reverse iterator that points to the</a>
<a name="1224"><span class="lineNum"> 1224 </span> : : * last element in the %deque. Iteration is done in reverse</a>
<a name="1225"><span class="lineNum"> 1225 </span> : : * element order.</a>
<a name="1226"><span class="lineNum"> 1226 </span> : : */</a>
<a name="1227"><span class="lineNum"> 1227 </span> : : reverse_iterator</a>
<a name="1228"><span class="lineNum"> 1228 </span> : : rbegin() _GLIBCXX_NOEXCEPT</a>
<a name="1229"><span class="lineNum"> 1229 </span> : : { return reverse_iterator(this-&gt;_M_impl._M_finish); }</a>
<a name="1230"><span class="lineNum"> 1230 </span> : : </a>
<a name="1231"><span class="lineNum"> 1231 </span> : : /**</a>
<a name="1232"><span class="lineNum"> 1232 </span> : : * Returns a read-only (constant) reverse iterator that points</a>
<a name="1233"><span class="lineNum"> 1233 </span> : : * to the last element in the %deque. Iteration is done in</a>
<a name="1234"><span class="lineNum"> 1234 </span> : : * reverse element order.</a>
<a name="1235"><span class="lineNum"> 1235 </span> : : */</a>
<a name="1236"><span class="lineNum"> 1236 </span> : : const_reverse_iterator</a>
<a name="1237"><span class="lineNum"> 1237 </span> : : rbegin() const _GLIBCXX_NOEXCEPT</a>
<a name="1238"><span class="lineNum"> 1238 </span> : : { return const_reverse_iterator(this-&gt;_M_impl._M_finish); }</a>
<a name="1239"><span class="lineNum"> 1239 </span> : : </a>
<a name="1240"><span class="lineNum"> 1240 </span> : : /**</a>
<a name="1241"><span class="lineNum"> 1241 </span> : : * Returns a read/write reverse iterator that points to one</a>
<a name="1242"><span class="lineNum"> 1242 </span> : : * before the first element in the %deque. Iteration is done</a>
<a name="1243"><span class="lineNum"> 1243 </span> : : * in reverse element order.</a>
<a name="1244"><span class="lineNum"> 1244 </span> : : */</a>
<a name="1245"><span class="lineNum"> 1245 </span> : : reverse_iterator</a>
<a name="1246"><span class="lineNum"> 1246 </span> : : rend() _GLIBCXX_NOEXCEPT</a>
<a name="1247"><span class="lineNum"> 1247 </span> : : { return reverse_iterator(this-&gt;_M_impl._M_start); }</a>
<a name="1248"><span class="lineNum"> 1248 </span> : : </a>
<a name="1249"><span class="lineNum"> 1249 </span> : : /**</a>
<a name="1250"><span class="lineNum"> 1250 </span> : : * Returns a read-only (constant) reverse iterator that points</a>
<a name="1251"><span class="lineNum"> 1251 </span> : : * to one before the first element in the %deque. Iteration is</a>
<a name="1252"><span class="lineNum"> 1252 </span> : : * done in reverse element order.</a>
<a name="1253"><span class="lineNum"> 1253 </span> : : */</a>
<a name="1254"><span class="lineNum"> 1254 </span> : : const_reverse_iterator</a>
<a name="1255"><span class="lineNum"> 1255 </span> : : rend() const _GLIBCXX_NOEXCEPT</a>
<a name="1256"><span class="lineNum"> 1256 </span> : : { return const_reverse_iterator(this-&gt;_M_impl._M_start); }</a>
<a name="1257"><span class="lineNum"> 1257 </span> : : </a>
<a name="1258"><span class="lineNum"> 1258 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1259"><span class="lineNum"> 1259 </span> : : /**</a>
<a name="1260"><span class="lineNum"> 1260 </span> : : * Returns a read-only (constant) iterator that points to the first</a>
<a name="1261"><span class="lineNum"> 1261 </span> : : * element in the %deque. Iteration is done in ordinary element order.</a>
<a name="1262"><span class="lineNum"> 1262 </span> : : */</a>
<a name="1263"><span class="lineNum"> 1263 </span> : : const_iterator</a>
<a name="1264"><span class="lineNum"> 1264 </span> : : cbegin() const noexcept</a>
<a name="1265"><span class="lineNum"> 1265 </span> : : { return this-&gt;_M_impl._M_start; }</a>
<a name="1266"><span class="lineNum"> 1266 </span> : : </a>
<a name="1267"><span class="lineNum"> 1267 </span> : : /**</a>
<a name="1268"><span class="lineNum"> 1268 </span> : : * Returns a read-only (constant) iterator that points one past</a>
<a name="1269"><span class="lineNum"> 1269 </span> : : * the last element in the %deque. Iteration is done in</a>
<a name="1270"><span class="lineNum"> 1270 </span> : : * ordinary element order.</a>
<a name="1271"><span class="lineNum"> 1271 </span> : : */</a>
<a name="1272"><span class="lineNum"> 1272 </span> : : const_iterator</a>
<a name="1273"><span class="lineNum"> 1273 </span> : : cend() const noexcept</a>
<a name="1274"><span class="lineNum"> 1274 </span> : : { return this-&gt;_M_impl._M_finish; }</a>
<a name="1275"><span class="lineNum"> 1275 </span> : : </a>
<a name="1276"><span class="lineNum"> 1276 </span> : : /**</a>
<a name="1277"><span class="lineNum"> 1277 </span> : : * Returns a read-only (constant) reverse iterator that points</a>
<a name="1278"><span class="lineNum"> 1278 </span> : : * to the last element in the %deque. Iteration is done in</a>
<a name="1279"><span class="lineNum"> 1279 </span> : : * reverse element order.</a>
<a name="1280"><span class="lineNum"> 1280 </span> : : */</a>
<a name="1281"><span class="lineNum"> 1281 </span> : : const_reverse_iterator</a>
<a name="1282"><span class="lineNum"> 1282 </span> : : crbegin() const noexcept</a>
<a name="1283"><span class="lineNum"> 1283 </span> : : { return const_reverse_iterator(this-&gt;_M_impl._M_finish); }</a>
<a name="1284"><span class="lineNum"> 1284 </span> : : </a>
<a name="1285"><span class="lineNum"> 1285 </span> : : /**</a>
<a name="1286"><span class="lineNum"> 1286 </span> : : * Returns a read-only (constant) reverse iterator that points</a>
<a name="1287"><span class="lineNum"> 1287 </span> : : * to one before the first element in the %deque. Iteration is</a>
<a name="1288"><span class="lineNum"> 1288 </span> : : * done in reverse element order.</a>
<a name="1289"><span class="lineNum"> 1289 </span> : : */</a>
<a name="1290"><span class="lineNum"> 1290 </span> : : const_reverse_iterator</a>
<a name="1291"><span class="lineNum"> 1291 </span> : : crend() const noexcept</a>
<a name="1292"><span class="lineNum"> 1292 </span> : : { return const_reverse_iterator(this-&gt;_M_impl._M_start); }</a>
<a name="1293"><span class="lineNum"> 1293 </span> : : #endif</a>
<a name="1294"><span class="lineNum"> 1294 </span> : : </a>
<a name="1295"><span class="lineNum"> 1295 </span> : : // [23.2.1.2] capacity</a>
<a name="1296"><span class="lineNum"> 1296 </span> : : /** Returns the number of elements in the %deque. */</a>
<a name="1297"><span class="lineNum"> 1297 </span> : : size_type</a>
<a name="1298"><span class="lineNum"> 1298 </span> :<span class="lineNoCov"> 0 : size() const _GLIBCXX_NOEXCEPT</span></a>
<a name="1299"><span class="lineNum"> 1299 </span> :<span class="lineNoCov"> 0 : { return this-&gt;_M_impl._M_finish - this-&gt;_M_impl._M_start; }</span></a>
<a name="1300"><span class="lineNum"> 1300 </span> : : </a>
<a name="1301"><span class="lineNum"> 1301 </span> : : /** Returns the size() of the largest possible %deque. */</a>
<a name="1302"><span class="lineNum"> 1302 </span> : : size_type</a>
<a name="1303"><span class="lineNum"> 1303 </span> :<span class="lineNoCov"> 0 : max_size() const _GLIBCXX_NOEXCEPT</span></a>
<a name="1304"><span class="lineNum"> 1304 </span> :<span class="lineNoCov"> 0 : { return _S_max_size(_M_get_Tp_allocator()); }</span></a>
<a name="1305"><span class="lineNum"> 1305 </span> : : </a>
<a name="1306"><span class="lineNum"> 1306 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1307"><span class="lineNum"> 1307 </span> : : /**</a>
<a name="1308"><span class="lineNum"> 1308 </span> : : * @brief Resizes the %deque to the specified number of elements.</a>
<a name="1309"><span class="lineNum"> 1309 </span> : : * @param __new_size Number of elements the %deque should contain.</a>
<a name="1310"><span class="lineNum"> 1310 </span> : : *</a>
<a name="1311"><span class="lineNum"> 1311 </span> : : * This function will %resize the %deque to the specified</a>
<a name="1312"><span class="lineNum"> 1312 </span> : : * number of elements. If the number is smaller than the</a>
<a name="1313"><span class="lineNum"> 1313 </span> : : * %deque's current size the %deque is truncated, otherwise</a>
<a name="1314"><span class="lineNum"> 1314 </span> : : * default constructed elements are appended.</a>
<a name="1315"><span class="lineNum"> 1315 </span> : : */</a>
<a name="1316"><span class="lineNum"> 1316 </span> : : void</a>
<a name="1317"><span class="lineNum"> 1317 </span> : : resize(size_type __new_size)</a>
<a name="1318"><span class="lineNum"> 1318 </span> : : {</a>
<a name="1319"><span class="lineNum"> 1319 </span> : : const size_type __len = size();</a>
<a name="1320"><span class="lineNum"> 1320 </span> : : if (__new_size &gt; __len)</a>
<a name="1321"><span class="lineNum"> 1321 </span> : : _M_default_append(__new_size - __len);</a>
<a name="1322"><span class="lineNum"> 1322 </span> : : else if (__new_size &lt; __len)</a>
<a name="1323"><span class="lineNum"> 1323 </span> : : _M_erase_at_end(this-&gt;_M_impl._M_start</a>
<a name="1324"><span class="lineNum"> 1324 </span> : : + difference_type(__new_size));</a>
<a name="1325"><span class="lineNum"> 1325 </span> : : }</a>
<a name="1326"><span class="lineNum"> 1326 </span> : : </a>
<a name="1327"><span class="lineNum"> 1327 </span> : : /**</a>
<a name="1328"><span class="lineNum"> 1328 </span> : : * @brief Resizes the %deque to the specified number of elements.</a>
<a name="1329"><span class="lineNum"> 1329 </span> : : * @param __new_size Number of elements the %deque should contain.</a>
<a name="1330"><span class="lineNum"> 1330 </span> : : * @param __x Data with which new elements should be populated.</a>
<a name="1331"><span class="lineNum"> 1331 </span> : : *</a>
<a name="1332"><span class="lineNum"> 1332 </span> : : * This function will %resize the %deque to the specified</a>
<a name="1333"><span class="lineNum"> 1333 </span> : : * number of elements. If the number is smaller than the</a>
<a name="1334"><span class="lineNum"> 1334 </span> : : * %deque's current size the %deque is truncated, otherwise the</a>
<a name="1335"><span class="lineNum"> 1335 </span> : : * %deque is extended and new elements are populated with given</a>
<a name="1336"><span class="lineNum"> 1336 </span> : : * data.</a>
<a name="1337"><span class="lineNum"> 1337 </span> : : */</a>
<a name="1338"><span class="lineNum"> 1338 </span> : : void</a>
<a name="1339"><span class="lineNum"> 1339 </span> : : resize(size_type __new_size, const value_type&amp; __x)</a>
<a name="1340"><span class="lineNum"> 1340 </span> : : {</a>
<a name="1341"><span class="lineNum"> 1341 </span> : : const size_type __len = size();</a>
<a name="1342"><span class="lineNum"> 1342 </span> : : if (__new_size &gt; __len)</a>
<a name="1343"><span class="lineNum"> 1343 </span> : : _M_fill_insert(this-&gt;_M_impl._M_finish, __new_size - __len, __x);</a>
<a name="1344"><span class="lineNum"> 1344 </span> : : else if (__new_size &lt; __len)</a>
<a name="1345"><span class="lineNum"> 1345 </span> : : _M_erase_at_end(this-&gt;_M_impl._M_start</a>
<a name="1346"><span class="lineNum"> 1346 </span> : : + difference_type(__new_size));</a>
<a name="1347"><span class="lineNum"> 1347 </span> : : }</a>
<a name="1348"><span class="lineNum"> 1348 </span> : : #else</a>
<a name="1349"><span class="lineNum"> 1349 </span> : : /**</a>
<a name="1350"><span class="lineNum"> 1350 </span> : : * @brief Resizes the %deque to the specified number of elements.</a>
<a name="1351"><span class="lineNum"> 1351 </span> : : * @param __new_size Number of elements the %deque should contain.</a>
<a name="1352"><span class="lineNum"> 1352 </span> : : * @param __x Data with which new elements should be populated.</a>
<a name="1353"><span class="lineNum"> 1353 </span> : : *</a>
<a name="1354"><span class="lineNum"> 1354 </span> : : * This function will %resize the %deque to the specified</a>
<a name="1355"><span class="lineNum"> 1355 </span> : : * number of elements. If the number is smaller than the</a>
<a name="1356"><span class="lineNum"> 1356 </span> : : * %deque's current size the %deque is truncated, otherwise the</a>
<a name="1357"><span class="lineNum"> 1357 </span> : : * %deque is extended and new elements are populated with given</a>
<a name="1358"><span class="lineNum"> 1358 </span> : : * data.</a>
<a name="1359"><span class="lineNum"> 1359 </span> : : */</a>
<a name="1360"><span class="lineNum"> 1360 </span> : : void</a>
<a name="1361"><span class="lineNum"> 1361 </span> : : resize(size_type __new_size, value_type __x = value_type())</a>
<a name="1362"><span class="lineNum"> 1362 </span> : : {</a>
<a name="1363"><span class="lineNum"> 1363 </span> : : const size_type __len = size();</a>
<a name="1364"><span class="lineNum"> 1364 </span> : : if (__new_size &gt; __len)</a>
<a name="1365"><span class="lineNum"> 1365 </span> : : _M_fill_insert(this-&gt;_M_impl._M_finish, __new_size - __len, __x);</a>
<a name="1366"><span class="lineNum"> 1366 </span> : : else if (__new_size &lt; __len)</a>
<a name="1367"><span class="lineNum"> 1367 </span> : : _M_erase_at_end(this-&gt;_M_impl._M_start</a>
<a name="1368"><span class="lineNum"> 1368 </span> : : + difference_type(__new_size));</a>
<a name="1369"><span class="lineNum"> 1369 </span> : : }</a>
<a name="1370"><span class="lineNum"> 1370 </span> : : #endif</a>
<a name="1371"><span class="lineNum"> 1371 </span> : : </a>
<a name="1372"><span class="lineNum"> 1372 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1373"><span class="lineNum"> 1373 </span> : : /** A non-binding request to reduce memory use. */</a>
<a name="1374"><span class="lineNum"> 1374 </span> : : void</a>
<a name="1375"><span class="lineNum"> 1375 </span> : : shrink_to_fit() noexcept</a>
<a name="1376"><span class="lineNum"> 1376 </span> : : { _M_shrink_to_fit(); }</a>
<a name="1377"><span class="lineNum"> 1377 </span> : : #endif</a>
<a name="1378"><span class="lineNum"> 1378 </span> : : </a>
<a name="1379"><span class="lineNum"> 1379 </span> : : /**</a>
<a name="1380"><span class="lineNum"> 1380 </span> : : * Returns true if the %deque is empty. (Thus begin() would</a>
<a name="1381"><span class="lineNum"> 1381 </span> : : * equal end().)</a>
<a name="1382"><span class="lineNum"> 1382 </span> : : */</a>
<a name="1383"><span class="lineNum"> 1383 </span> : : _GLIBCXX_NODISCARD bool</a>
<a name="1384"><span class="lineNum"> 1384 </span> :<span class="lineCov"> 4 : empty() const _GLIBCXX_NOEXCEPT</span></a>
<a name="1385"><span class="lineNum"> 1385 </span> :<span class="lineCov"> 4 : { return this-&gt;_M_impl._M_finish == this-&gt;_M_impl._M_start; }</span></a>
<a name="1386"><span class="lineNum"> 1386 </span> : : </a>
<a name="1387"><span class="lineNum"> 1387 </span> : : // element access</a>
<a name="1388"><span class="lineNum"> 1388 </span> : : /**</a>
<a name="1389"><span class="lineNum"> 1389 </span> : : * @brief Subscript access to the data contained in the %deque.</a>
<a name="1390"><span class="lineNum"> 1390 </span> : : * @param __n The index of the element for which data should be</a>
<a name="1391"><span class="lineNum"> 1391 </span> : : * accessed.</a>
<a name="1392"><span class="lineNum"> 1392 </span> : : * @return Read/write reference to data.</a>
<a name="1393"><span class="lineNum"> 1393 </span> : : *</a>
<a name="1394"><span class="lineNum"> 1394 </span> : : * This operator allows for easy, array-style, data access.</a>
<a name="1395"><span class="lineNum"> 1395 </span> : : * Note that data access with this operator is unchecked and</a>
<a name="1396"><span class="lineNum"> 1396 </span> : : * out_of_range lookups are not defined. (For checked lookups</a>
<a name="1397"><span class="lineNum"> 1397 </span> : : * see at().)</a>
<a name="1398"><span class="lineNum"> 1398 </span> : : */</a>
<a name="1399"><span class="lineNum"> 1399 </span> : : reference</a>
<a name="1400"><span class="lineNum"> 1400 </span> : : operator[](size_type __n) _GLIBCXX_NOEXCEPT</a>
<a name="1401"><span class="lineNum"> 1401 </span> : : {</a>
<a name="1402"><span class="lineNum"> 1402 </span> : : __glibcxx_requires_subscript(__n);</a>
<a name="1403"><span class="lineNum"> 1403 </span> : : return this-&gt;_M_impl._M_start[difference_type(__n)];</a>
<a name="1404"><span class="lineNum"> 1404 </span> : : }</a>
<a name="1405"><span class="lineNum"> 1405 </span> : : </a>
<a name="1406"><span class="lineNum"> 1406 </span> : : /**</a>
<a name="1407"><span class="lineNum"> 1407 </span> : : * @brief Subscript access to the data contained in the %deque.</a>
<a name="1408"><span class="lineNum"> 1408 </span> : : * @param __n The index of the element for which data should be</a>
<a name="1409"><span class="lineNum"> 1409 </span> : : * accessed.</a>
<a name="1410"><span class="lineNum"> 1410 </span> : : * @return Read-only (constant) reference to data.</a>
<a name="1411"><span class="lineNum"> 1411 </span> : : *</a>
<a name="1412"><span class="lineNum"> 1412 </span> : : * This operator allows for easy, array-style, data access.</a>
<a name="1413"><span class="lineNum"> 1413 </span> : : * Note that data access with this operator is unchecked and</a>
<a name="1414"><span class="lineNum"> 1414 </span> : : * out_of_range lookups are not defined. (For checked lookups</a>
<a name="1415"><span class="lineNum"> 1415 </span> : : * see at().)</a>
<a name="1416"><span class="lineNum"> 1416 </span> : : */</a>
<a name="1417"><span class="lineNum"> 1417 </span> : : const_reference</a>
<a name="1418"><span class="lineNum"> 1418 </span> : : operator[](size_type __n) const _GLIBCXX_NOEXCEPT</a>
<a name="1419"><span class="lineNum"> 1419 </span> : : {</a>
<a name="1420"><span class="lineNum"> 1420 </span> : : __glibcxx_requires_subscript(__n);</a>
<a name="1421"><span class="lineNum"> 1421 </span> : : return this-&gt;_M_impl._M_start[difference_type(__n)];</a>
<a name="1422"><span class="lineNum"> 1422 </span> : : }</a>
<a name="1423"><span class="lineNum"> 1423 </span> : : </a>
<a name="1424"><span class="lineNum"> 1424 </span> : : protected:</a>
<a name="1425"><span class="lineNum"> 1425 </span> : : /// Safety check used only from at().</a>
<a name="1426"><span class="lineNum"> 1426 </span> : : void</a>
<a name="1427"><span class="lineNum"> 1427 </span> : : _M_range_check(size_type __n) const</a>
<a name="1428"><span class="lineNum"> 1428 </span> : : {</a>
<a name="1429"><span class="lineNum"> 1429 </span> : : if (__n &gt;= this-&gt;size())</a>
<a name="1430"><span class="lineNum"> 1430 </span> : : __throw_out_of_range_fmt(__N(&quot;deque::_M_range_check: __n &quot;</a>
<a name="1431"><span class="lineNum"> 1431 </span> : : &quot;(which is %zu)&gt;= this-&gt;size() &quot;</a>
<a name="1432"><span class="lineNum"> 1432 </span> : : &quot;(which is %zu)&quot;),</a>
<a name="1433"><span class="lineNum"> 1433 </span> : : __n, this-&gt;size());</a>
<a name="1434"><span class="lineNum"> 1434 </span> : : }</a>
<a name="1435"><span class="lineNum"> 1435 </span> : : </a>
<a name="1436"><span class="lineNum"> 1436 </span> : : public:</a>
<a name="1437"><span class="lineNum"> 1437 </span> : : /**</a>
<a name="1438"><span class="lineNum"> 1438 </span> : : * @brief Provides access to the data contained in the %deque.</a>
<a name="1439"><span class="lineNum"> 1439 </span> : : * @param __n The index of the element for which data should be</a>
<a name="1440"><span class="lineNum"> 1440 </span> : : * accessed.</a>
<a name="1441"><span class="lineNum"> 1441 </span> : : * @return Read/write reference to data.</a>
<a name="1442"><span class="lineNum"> 1442 </span> : : * @throw std::out_of_range If @a __n is an invalid index.</a>
<a name="1443"><span class="lineNum"> 1443 </span> : : *</a>
<a name="1444"><span class="lineNum"> 1444 </span> : : * This function provides for safer data access. The parameter</a>
<a name="1445"><span class="lineNum"> 1445 </span> : : * is first checked that it is in the range of the deque. The</a>
<a name="1446"><span class="lineNum"> 1446 </span> : : * function throws out_of_range if the check fails.</a>
<a name="1447"><span class="lineNum"> 1447 </span> : : */</a>
<a name="1448"><span class="lineNum"> 1448 </span> : : reference</a>
<a name="1449"><span class="lineNum"> 1449 </span> : : at(size_type __n)</a>
<a name="1450"><span class="lineNum"> 1450 </span> : : {</a>
<a name="1451"><span class="lineNum"> 1451 </span> : : _M_range_check(__n);</a>
<a name="1452"><span class="lineNum"> 1452 </span> : : return (*this)[__n];</a>
<a name="1453"><span class="lineNum"> 1453 </span> : : }</a>
<a name="1454"><span class="lineNum"> 1454 </span> : : </a>
<a name="1455"><span class="lineNum"> 1455 </span> : : /**</a>
<a name="1456"><span class="lineNum"> 1456 </span> : : * @brief Provides access to the data contained in the %deque.</a>
<a name="1457"><span class="lineNum"> 1457 </span> : : * @param __n The index of the element for which data should be</a>
<a name="1458"><span class="lineNum"> 1458 </span> : : * accessed.</a>
<a name="1459"><span class="lineNum"> 1459 </span> : : * @return Read-only (constant) reference to data.</a>
<a name="1460"><span class="lineNum"> 1460 </span> : : * @throw std::out_of_range If @a __n is an invalid index.</a>
<a name="1461"><span class="lineNum"> 1461 </span> : : *</a>
<a name="1462"><span class="lineNum"> 1462 </span> : : * This function provides for safer data access. The parameter is first</a>
<a name="1463"><span class="lineNum"> 1463 </span> : : * checked that it is in the range of the deque. The function throws</a>
<a name="1464"><span class="lineNum"> 1464 </span> : : * out_of_range if the check fails.</a>
<a name="1465"><span class="lineNum"> 1465 </span> : : */</a>
<a name="1466"><span class="lineNum"> 1466 </span> : : const_reference</a>
<a name="1467"><span class="lineNum"> 1467 </span> : : at(size_type __n) const</a>
<a name="1468"><span class="lineNum"> 1468 </span> : : {</a>
<a name="1469"><span class="lineNum"> 1469 </span> : : _M_range_check(__n);</a>
<a name="1470"><span class="lineNum"> 1470 </span> : : return (*this)[__n];</a>
<a name="1471"><span class="lineNum"> 1471 </span> : : }</a>
<a name="1472"><span class="lineNum"> 1472 </span> : : </a>
<a name="1473"><span class="lineNum"> 1473 </span> : : /**</a>
<a name="1474"><span class="lineNum"> 1474 </span> : : * Returns a read/write reference to the data at the first</a>
<a name="1475"><span class="lineNum"> 1475 </span> : : * element of the %deque.</a>
<a name="1476"><span class="lineNum"> 1476 </span> : : */</a>
<a name="1477"><span class="lineNum"> 1477 </span> : : reference</a>
<a name="1478"><span class="lineNum"> 1478 </span> : : front() _GLIBCXX_NOEXCEPT</a>
<a name="1479"><span class="lineNum"> 1479 </span> : : {</a>
<a name="1480"><span class="lineNum"> 1480 </span> : : __glibcxx_requires_nonempty();</a>
<a name="1481"><span class="lineNum"> 1481 </span> : : return *begin();</a>
<a name="1482"><span class="lineNum"> 1482 </span> : : }</a>
<a name="1483"><span class="lineNum"> 1483 </span> : : </a>
<a name="1484"><span class="lineNum"> 1484 </span> : : /**</a>
<a name="1485"><span class="lineNum"> 1485 </span> : : * Returns a read-only (constant) reference to the data at the first</a>
<a name="1486"><span class="lineNum"> 1486 </span> : : * element of the %deque.</a>
<a name="1487"><span class="lineNum"> 1487 </span> : : */</a>
<a name="1488"><span class="lineNum"> 1488 </span> : : const_reference</a>
<a name="1489"><span class="lineNum"> 1489 </span> : : front() const _GLIBCXX_NOEXCEPT</a>
<a name="1490"><span class="lineNum"> 1490 </span> : : {</a>
<a name="1491"><span class="lineNum"> 1491 </span> : : __glibcxx_requires_nonempty();</a>
<a name="1492"><span class="lineNum"> 1492 </span> : : return *begin();</a>
<a name="1493"><span class="lineNum"> 1493 </span> : : }</a>
<a name="1494"><span class="lineNum"> 1494 </span> : : </a>
<a name="1495"><span class="lineNum"> 1495 </span> : : /**</a>
<a name="1496"><span class="lineNum"> 1496 </span> : : * Returns a read/write reference to the data at the last element of the</a>
<a name="1497"><span class="lineNum"> 1497 </span> : : * %deque.</a>
<a name="1498"><span class="lineNum"> 1498 </span> : : */</a>
<a name="1499"><span class="lineNum"> 1499 </span> : : reference</a>
<a name="1500"><span class="lineNum"> 1500 </span> :<span class="lineCov"> 3 : back() _GLIBCXX_NOEXCEPT</span></a>
<a name="1501"><span class="lineNum"> 1501 </span> : : {</a>
<a name="1502"><span class="lineNum"> 1502 </span> : : __glibcxx_requires_nonempty();</a>
<a name="1503"><span class="lineNum"> 1503 </span> :<span class="lineCov"> 3 : iterator __tmp = end();</span></a>
<a name="1504"><span class="lineNum"> 1504 </span> :<span class="lineCov"> 3 : --__tmp;</span></a>
<a name="1505"><span class="lineNum"> 1505 </span> :<span class="lineCov"> 3 : return *__tmp;</span></a>
<a name="1506"><span class="lineNum"> 1506 </span> : : }</a>
<a name="1507"><span class="lineNum"> 1507 </span> : : </a>
<a name="1508"><span class="lineNum"> 1508 </span> : : /**</a>
<a name="1509"><span class="lineNum"> 1509 </span> : : * Returns a read-only (constant) reference to the data at the last</a>
<a name="1510"><span class="lineNum"> 1510 </span> : : * element of the %deque.</a>
<a name="1511"><span class="lineNum"> 1511 </span> : : */</a>
<a name="1512"><span class="lineNum"> 1512 </span> : : const_reference</a>
<a name="1513"><span class="lineNum"> 1513 </span> : : back() const _GLIBCXX_NOEXCEPT</a>
<a name="1514"><span class="lineNum"> 1514 </span> : : {</a>
<a name="1515"><span class="lineNum"> 1515 </span> : : __glibcxx_requires_nonempty();</a>
<a name="1516"><span class="lineNum"> 1516 </span> : : const_iterator __tmp = end();</a>
<a name="1517"><span class="lineNum"> 1517 </span> : : --__tmp;</a>
<a name="1518"><span class="lineNum"> 1518 </span> : : return *__tmp;</a>
<a name="1519"><span class="lineNum"> 1519 </span> : : }</a>
<a name="1520"><span class="lineNum"> 1520 </span> : : </a>
<a name="1521"><span class="lineNum"> 1521 </span> : : // [23.2.1.2] modifiers</a>
<a name="1522"><span class="lineNum"> 1522 </span> : : /**</a>
<a name="1523"><span class="lineNum"> 1523 </span> : : * @brief Add data to the front of the %deque.</a>
<a name="1524"><span class="lineNum"> 1524 </span> : : * @param __x Data to be added.</a>
<a name="1525"><span class="lineNum"> 1525 </span> : : *</a>
<a name="1526"><span class="lineNum"> 1526 </span> : : * This is a typical stack operation. The function creates an</a>
<a name="1527"><span class="lineNum"> 1527 </span> : : * element at the front of the %deque and assigns the given</a>
<a name="1528"><span class="lineNum"> 1528 </span> : : * data to it. Due to the nature of a %deque this operation</a>
<a name="1529"><span class="lineNum"> 1529 </span> : : * can be done in constant time.</a>
<a name="1530"><span class="lineNum"> 1530 </span> : : */</a>
<a name="1531"><span class="lineNum"> 1531 </span> : : void</a>
<a name="1532"><span class="lineNum"> 1532 </span> : : push_front(const value_type&amp; __x)</a>
<a name="1533"><span class="lineNum"> 1533 </span> : : {</a>
<a name="1534"><span class="lineNum"> 1534 </span> : : if (this-&gt;_M_impl._M_start._M_cur != this-&gt;_M_impl._M_start._M_first)</a>
<a name="1535"><span class="lineNum"> 1535 </span> : : {</a>
<a name="1536"><span class="lineNum"> 1536 </span> : : _Alloc_traits::construct(this-&gt;_M_impl,</a>
<a name="1537"><span class="lineNum"> 1537 </span> : : this-&gt;_M_impl._M_start._M_cur - 1,</a>
<a name="1538"><span class="lineNum"> 1538 </span> : : __x);</a>
<a name="1539"><span class="lineNum"> 1539 </span> : : --this-&gt;_M_impl._M_start._M_cur;</a>
<a name="1540"><span class="lineNum"> 1540 </span> : : }</a>
<a name="1541"><span class="lineNum"> 1541 </span> : : else</a>
<a name="1542"><span class="lineNum"> 1542 </span> : : _M_push_front_aux(__x);</a>
<a name="1543"><span class="lineNum"> 1543 </span> : : }</a>
<a name="1544"><span class="lineNum"> 1544 </span> : : </a>
<a name="1545"><span class="lineNum"> 1545 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1546"><span class="lineNum"> 1546 </span> : : void</a>
<a name="1547"><span class="lineNum"> 1547 </span> : : push_front(value_type&amp;&amp; __x)</a>
<a name="1548"><span class="lineNum"> 1548 </span> : : { emplace_front(std::move(__x)); }</a>
<a name="1549"><span class="lineNum"> 1549 </span> : : </a>
<a name="1550"><span class="lineNum"> 1550 </span> : : template&lt;typename... _Args&gt;</a>
<a name="1551"><span class="lineNum"> 1551 </span> : : #if __cplusplus &gt; 201402L</a>
<a name="1552"><span class="lineNum"> 1552 </span> : : reference</a>
<a name="1553"><span class="lineNum"> 1553 </span> : : #else</a>
<a name="1554"><span class="lineNum"> 1554 </span> : : void</a>
<a name="1555"><span class="lineNum"> 1555 </span> : : #endif</a>
<a name="1556"><span class="lineNum"> 1556 </span> : : emplace_front(_Args&amp;&amp;... __args);</a>
<a name="1557"><span class="lineNum"> 1557 </span> : : #endif</a>
<a name="1558"><span class="lineNum"> 1558 </span> : : </a>
<a name="1559"><span class="lineNum"> 1559 </span> : : /**</a>
<a name="1560"><span class="lineNum"> 1560 </span> : : * @brief Add data to the end of the %deque.</a>
<a name="1561"><span class="lineNum"> 1561 </span> : : * @param __x Data to be added.</a>
<a name="1562"><span class="lineNum"> 1562 </span> : : *</a>
<a name="1563"><span class="lineNum"> 1563 </span> : : * This is a typical stack operation. The function creates an</a>
<a name="1564"><span class="lineNum"> 1564 </span> : : * element at the end of the %deque and assigns the given data</a>
<a name="1565"><span class="lineNum"> 1565 </span> : : * to it. Due to the nature of a %deque this operation can be</a>
<a name="1566"><span class="lineNum"> 1566 </span> : : * done in constant time.</a>
<a name="1567"><span class="lineNum"> 1567 </span> : : */</a>
<a name="1568"><span class="lineNum"> 1568 </span> : : void</a>
<a name="1569"><span class="lineNum"> 1569 </span> :<span class="lineNoCov"> 0 : push_back(const value_type&amp; __x)</span></a>
<a name="1570"><span class="lineNum"> 1570 </span> : : {</a>
<a name="1571"><span class="lineNum"> 1571 </span> :<span class="lineNoCov"> 0 : if (this-&gt;_M_impl._M_finish._M_cur</span></a>
<a name="1572"><span class="lineNum"> 1572 </span> [<span class="branchNoExec" title="Branch 0 was not executed"> # </span><span class="branchNoExec" title="Branch 1 was not executed"> # </span>]:<span class="lineNoCov"> 0 : != this-&gt;_M_impl._M_finish._M_last - 1)</span></a>
<a name="1573"><span class="lineNum"> 1573 </span> : : {</a>
<a name="1574"><span class="lineNum"> 1574 </span> :<span class="lineNoCov"> 0 : _Alloc_traits::construct(this-&gt;_M_impl,</span></a>
<a name="1575"><span class="lineNum"> 1575 </span> : : this-&gt;_M_impl._M_finish._M_cur, __x);</a>
<a name="1576"><span class="lineNum"> 1576 </span> :<span class="lineNoCov"> 0 : ++this-&gt;_M_impl._M_finish._M_cur;</span></a>
<a name="1577"><span class="lineNum"> 1577 </span> : : }</a>
<a name="1578"><span class="lineNum"> 1578 </span> : : else</a>
<a name="1579"><span class="lineNum"> 1579 </span> :<span class="lineNoCov"> 0 : _M_push_back_aux(__x);</span></a>
<a name="1580"><span class="lineNum"> 1580 </span> :<span class="lineNoCov"> 0 : }</span></a>
<a name="1581"><span class="lineNum"> 1581 </span> : : </a>
<a name="1582"><span class="lineNum"> 1582 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1583"><span class="lineNum"> 1583 </span> : : void</a>
<a name="1584"><span class="lineNum"> 1584 </span> :<span class="lineCov"> 3 : push_back(value_type&amp;&amp; __x)</span></a>
<a name="1585"><span class="lineNum"> 1585 </span> :<span class="lineCov"> 3 : { emplace_back(std::move(__x)); }</span></a>
<a name="1586"><span class="lineNum"> 1586 </span> : : </a>
<a name="1587"><span class="lineNum"> 1587 </span> : : template&lt;typename... _Args&gt;</a>
<a name="1588"><span class="lineNum"> 1588 </span> : : #if __cplusplus &gt; 201402L</a>
<a name="1589"><span class="lineNum"> 1589 </span> : : reference</a>
<a name="1590"><span class="lineNum"> 1590 </span> : : #else</a>
<a name="1591"><span class="lineNum"> 1591 </span> : : void</a>
<a name="1592"><span class="lineNum"> 1592 </span> : : #endif</a>
<a name="1593"><span class="lineNum"> 1593 </span> : : emplace_back(_Args&amp;&amp;... __args);</a>
<a name="1594"><span class="lineNum"> 1594 </span> : : #endif</a>
<a name="1595"><span class="lineNum"> 1595 </span> : : </a>
<a name="1596"><span class="lineNum"> 1596 </span> : : /**</a>
<a name="1597"><span class="lineNum"> 1597 </span> : : * @brief Removes first element.</a>
<a name="1598"><span class="lineNum"> 1598 </span> : : *</a>
<a name="1599"><span class="lineNum"> 1599 </span> : : * This is a typical stack operation. It shrinks the %deque by one.</a>
<a name="1600"><span class="lineNum"> 1600 </span> : : *</a>
<a name="1601"><span class="lineNum"> 1601 </span> : : * Note that no data is returned, and if the first element's data is</a>
<a name="1602"><span class="lineNum"> 1602 </span> : : * needed, it should be retrieved before pop_front() is called.</a>
<a name="1603"><span class="lineNum"> 1603 </span> : : */</a>
<a name="1604"><span class="lineNum"> 1604 </span> : : void</a>
<a name="1605"><span class="lineNum"> 1605 </span> : : pop_front() _GLIBCXX_NOEXCEPT</a>
<a name="1606"><span class="lineNum"> 1606 </span> : : {</a>
<a name="1607"><span class="lineNum"> 1607 </span> : : __glibcxx_requires_nonempty();</a>
<a name="1608"><span class="lineNum"> 1608 </span> : : if (this-&gt;_M_impl._M_start._M_cur</a>
<a name="1609"><span class="lineNum"> 1609 </span> : : != this-&gt;_M_impl._M_start._M_last - 1)</a>
<a name="1610"><span class="lineNum"> 1610 </span> : : {</a>
<a name="1611"><span class="lineNum"> 1611 </span> : : _Alloc_traits::destroy(this-&gt;_M_impl,</a>
<a name="1612"><span class="lineNum"> 1612 </span> : : this-&gt;_M_impl._M_start._M_cur);</a>
<a name="1613"><span class="lineNum"> 1613 </span> : : ++this-&gt;_M_impl._M_start._M_cur;</a>
<a name="1614"><span class="lineNum"> 1614 </span> : : }</a>
<a name="1615"><span class="lineNum"> 1615 </span> : : else</a>
<a name="1616"><span class="lineNum"> 1616 </span> : : _M_pop_front_aux();</a>
<a name="1617"><span class="lineNum"> 1617 </span> : : }</a>
<a name="1618"><span class="lineNum"> 1618 </span> : : </a>
<a name="1619"><span class="lineNum"> 1619 </span> : : /**</a>
<a name="1620"><span class="lineNum"> 1620 </span> : : * @brief Removes last element.</a>
<a name="1621"><span class="lineNum"> 1621 </span> : : *</a>
<a name="1622"><span class="lineNum"> 1622 </span> : : * This is a typical stack operation. It shrinks the %deque by one.</a>
<a name="1623"><span class="lineNum"> 1623 </span> : : *</a>
<a name="1624"><span class="lineNum"> 1624 </span> : : * Note that no data is returned, and if the last element's data is</a>
<a name="1625"><span class="lineNum"> 1625 </span> : : * needed, it should be retrieved before pop_back() is called.</a>
<a name="1626"><span class="lineNum"> 1626 </span> : : */</a>
<a name="1627"><span class="lineNum"> 1627 </span> : : void</a>
<a name="1628"><span class="lineNum"> 1628 </span> :<span class="lineCov"> 2 : pop_back() _GLIBCXX_NOEXCEPT</span></a>
<a name="1629"><span class="lineNum"> 1629 </span> : : {</a>
<a name="1630"><span class="lineNum"> 1630 </span> : : __glibcxx_requires_nonempty();</a>
<a name="1631"><span class="lineNum"> 1631 </span> :<span class="lineCov"> 2 : if (this-&gt;_M_impl._M_finish._M_cur</span></a>
<a name="1632"><span class="lineNum"> 1632 </span> [<span class="branchCov" title="Branch 0 was taken 2 times"> + </span><span class="branchNoCov" title="Branch 1 was not taken"> - </span>]:<span class="lineCov"> 2 : != this-&gt;_M_impl._M_finish._M_first)</span></a>
<a name="1633"><span class="lineNum"> 1633 </span> : : {</a>
<a name="1634"><span class="lineNum"> 1634 </span> :<span class="lineCov"> 2 : --this-&gt;_M_impl._M_finish._M_cur;</span></a>
<a name="1635"><span class="lineNum"> 1635 </span> :<span class="lineCov"> 2 : _Alloc_traits::destroy(this-&gt;_M_impl,</span></a>
<a name="1636"><span class="lineNum"> 1636 </span> : : this-&gt;_M_impl._M_finish._M_cur);</a>
<a name="1637"><span class="lineNum"> 1637 </span> : : }</a>
<a name="1638"><span class="lineNum"> 1638 </span> : : else</a>
<a name="1639"><span class="lineNum"> 1639 </span> :<span class="lineNoCov"> 0 : _M_pop_back_aux();</span></a>
<a name="1640"><span class="lineNum"> 1640 </span> :<span class="lineCov"> 2 : }</span></a>
<a name="1641"><span class="lineNum"> 1641 </span> : : </a>
<a name="1642"><span class="lineNum"> 1642 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1643"><span class="lineNum"> 1643 </span> : : /**</a>
<a name="1644"><span class="lineNum"> 1644 </span> : : * @brief Inserts an object in %deque before specified iterator.</a>
<a name="1645"><span class="lineNum"> 1645 </span> : : * @param __position A const_iterator into the %deque.</a>
<a name="1646"><span class="lineNum"> 1646 </span> : : * @param __args Arguments.</a>
<a name="1647"><span class="lineNum"> 1647 </span> : : * @return An iterator that points to the inserted data.</a>
<a name="1648"><span class="lineNum"> 1648 </span> : : *</a>
<a name="1649"><span class="lineNum"> 1649 </span> : : * This function will insert an object of type T constructed</a>
<a name="1650"><span class="lineNum"> 1650 </span> : : * with T(std::forward&lt;Args&gt;(args)...) before the specified location.</a>
<a name="1651"><span class="lineNum"> 1651 </span> : : */</a>
<a name="1652"><span class="lineNum"> 1652 </span> : : template&lt;typename... _Args&gt;</a>
<a name="1653"><span class="lineNum"> 1653 </span> : : iterator</a>
<a name="1654"><span class="lineNum"> 1654 </span> : : emplace(const_iterator __position, _Args&amp;&amp;... __args);</a>
<a name="1655"><span class="lineNum"> 1655 </span> : : </a>
<a name="1656"><span class="lineNum"> 1656 </span> : : /**</a>
<a name="1657"><span class="lineNum"> 1657 </span> : : * @brief Inserts given value into %deque before specified iterator.</a>
<a name="1658"><span class="lineNum"> 1658 </span> : : * @param __position A const_iterator into the %deque.</a>
<a name="1659"><span class="lineNum"> 1659 </span> : : * @param __x Data to be inserted.</a>
<a name="1660"><span class="lineNum"> 1660 </span> : : * @return An iterator that points to the inserted data.</a>
<a name="1661"><span class="lineNum"> 1661 </span> : : *</a>
<a name="1662"><span class="lineNum"> 1662 </span> : : * This function will insert a copy of the given value before the</a>
<a name="1663"><span class="lineNum"> 1663 </span> : : * specified location.</a>
<a name="1664"><span class="lineNum"> 1664 </span> : : */</a>
<a name="1665"><span class="lineNum"> 1665 </span> : : iterator</a>
<a name="1666"><span class="lineNum"> 1666 </span> : : insert(const_iterator __position, const value_type&amp; __x);</a>
<a name="1667"><span class="lineNum"> 1667 </span> : : #else</a>
<a name="1668"><span class="lineNum"> 1668 </span> : : /**</a>
<a name="1669"><span class="lineNum"> 1669 </span> : : * @brief Inserts given value into %deque before specified iterator.</a>
<a name="1670"><span class="lineNum"> 1670 </span> : : * @param __position An iterator into the %deque.</a>
<a name="1671"><span class="lineNum"> 1671 </span> : : * @param __x Data to be inserted.</a>
<a name="1672"><span class="lineNum"> 1672 </span> : : * @return An iterator that points to the inserted data.</a>
<a name="1673"><span class="lineNum"> 1673 </span> : : *</a>
<a name="1674"><span class="lineNum"> 1674 </span> : : * This function will insert a copy of the given value before the</a>
<a name="1675"><span class="lineNum"> 1675 </span> : : * specified location.</a>
<a name="1676"><span class="lineNum"> 1676 </span> : : */</a>
<a name="1677"><span class="lineNum"> 1677 </span> : : iterator</a>
<a name="1678"><span class="lineNum"> 1678 </span> : : insert(iterator __position, const value_type&amp; __x);</a>
<a name="1679"><span class="lineNum"> 1679 </span> : : #endif</a>
<a name="1680"><span class="lineNum"> 1680 </span> : : </a>
<a name="1681"><span class="lineNum"> 1681 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1682"><span class="lineNum"> 1682 </span> : : /**</a>
<a name="1683"><span class="lineNum"> 1683 </span> : : * @brief Inserts given rvalue into %deque before specified iterator.</a>
<a name="1684"><span class="lineNum"> 1684 </span> : : * @param __position A const_iterator into the %deque.</a>
<a name="1685"><span class="lineNum"> 1685 </span> : : * @param __x Data to be inserted.</a>
<a name="1686"><span class="lineNum"> 1686 </span> : : * @return An iterator that points to the inserted data.</a>
<a name="1687"><span class="lineNum"> 1687 </span> : : *</a>
<a name="1688"><span class="lineNum"> 1688 </span> : : * This function will insert a copy of the given rvalue before the</a>
<a name="1689"><span class="lineNum"> 1689 </span> : : * specified location.</a>
<a name="1690"><span class="lineNum"> 1690 </span> : : */</a>
<a name="1691"><span class="lineNum"> 1691 </span> : : iterator</a>
<a name="1692"><span class="lineNum"> 1692 </span> : : insert(const_iterator __position, value_type&amp;&amp; __x)</a>
<a name="1693"><span class="lineNum"> 1693 </span> : : { return emplace(__position, std::move(__x)); }</a>
<a name="1694"><span class="lineNum"> 1694 </span> : : </a>
<a name="1695"><span class="lineNum"> 1695 </span> : : /**</a>
<a name="1696"><span class="lineNum"> 1696 </span> : : * @brief Inserts an initializer list into the %deque.</a>
<a name="1697"><span class="lineNum"> 1697 </span> : : * @param __p An iterator into the %deque.</a>
<a name="1698"><span class="lineNum"> 1698 </span> : : * @param __l An initializer_list.</a>
<a name="1699"><span class="lineNum"> 1699 </span> : : *</a>
<a name="1700"><span class="lineNum"> 1700 </span> : : * This function will insert copies of the data in the</a>
<a name="1701"><span class="lineNum"> 1701 </span> : : * initializer_list @a __l into the %deque before the location</a>
<a name="1702"><span class="lineNum"> 1702 </span> : : * specified by @a __p. This is known as &lt;em&gt;list insert&lt;/em&gt;.</a>
<a name="1703"><span class="lineNum"> 1703 </span> : : */</a>
<a name="1704"><span class="lineNum"> 1704 </span> : : iterator</a>
<a name="1705"><span class="lineNum"> 1705 </span> : : insert(const_iterator __p, initializer_list&lt;value_type&gt; __l)</a>
<a name="1706"><span class="lineNum"> 1706 </span> : : {</a>
<a name="1707"><span class="lineNum"> 1707 </span> : : auto __offset = __p - cbegin();</a>
<a name="1708"><span class="lineNum"> 1708 </span> : : _M_range_insert_aux(__p._M_const_cast(), __l.begin(), __l.end(),</a>
<a name="1709"><span class="lineNum"> 1709 </span> : : std::random_access_iterator_tag());</a>
<a name="1710"><span class="lineNum"> 1710 </span> : : return begin() + __offset;</a>
<a name="1711"><span class="lineNum"> 1711 </span> : : }</a>
<a name="1712"><span class="lineNum"> 1712 </span> : : #endif</a>
<a name="1713"><span class="lineNum"> 1713 </span> : : </a>
<a name="1714"><span class="lineNum"> 1714 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1715"><span class="lineNum"> 1715 </span> : : /**</a>
<a name="1716"><span class="lineNum"> 1716 </span> : : * @brief Inserts a number of copies of given data into the %deque.</a>
<a name="1717"><span class="lineNum"> 1717 </span> : : * @param __position A const_iterator into the %deque.</a>
<a name="1718"><span class="lineNum"> 1718 </span> : : * @param __n Number of elements to be inserted.</a>
<a name="1719"><span class="lineNum"> 1719 </span> : : * @param __x Data to be inserted.</a>
<a name="1720"><span class="lineNum"> 1720 </span> : : * @return An iterator that points to the inserted data.</a>
<a name="1721"><span class="lineNum"> 1721 </span> : : *</a>
<a name="1722"><span class="lineNum"> 1722 </span> : : * This function will insert a specified number of copies of the given</a>
<a name="1723"><span class="lineNum"> 1723 </span> : : * data before the location specified by @a __position.</a>
<a name="1724"><span class="lineNum"> 1724 </span> : : */</a>
<a name="1725"><span class="lineNum"> 1725 </span> : : iterator</a>
<a name="1726"><span class="lineNum"> 1726 </span> : : insert(const_iterator __position, size_type __n, const value_type&amp; __x)</a>
<a name="1727"><span class="lineNum"> 1727 </span> : : {</a>
<a name="1728"><span class="lineNum"> 1728 </span> : : difference_type __offset = __position - cbegin();</a>
<a name="1729"><span class="lineNum"> 1729 </span> : : _M_fill_insert(__position._M_const_cast(), __n, __x);</a>
<a name="1730"><span class="lineNum"> 1730 </span> : : return begin() + __offset;</a>
<a name="1731"><span class="lineNum"> 1731 </span> : : }</a>
<a name="1732"><span class="lineNum"> 1732 </span> : : #else</a>
<a name="1733"><span class="lineNum"> 1733 </span> : : /**</a>
<a name="1734"><span class="lineNum"> 1734 </span> : : * @brief Inserts a number of copies of given data into the %deque.</a>
<a name="1735"><span class="lineNum"> 1735 </span> : : * @param __position An iterator into the %deque.</a>
<a name="1736"><span class="lineNum"> 1736 </span> : : * @param __n Number of elements to be inserted.</a>
<a name="1737"><span class="lineNum"> 1737 </span> : : * @param __x Data to be inserted.</a>
<a name="1738"><span class="lineNum"> 1738 </span> : : *</a>
<a name="1739"><span class="lineNum"> 1739 </span> : : * This function will insert a specified number of copies of the given</a>
<a name="1740"><span class="lineNum"> 1740 </span> : : * data before the location specified by @a __position.</a>
<a name="1741"><span class="lineNum"> 1741 </span> : : */</a>
<a name="1742"><span class="lineNum"> 1742 </span> : : void</a>
<a name="1743"><span class="lineNum"> 1743 </span> : : insert(iterator __position, size_type __n, const value_type&amp; __x)</a>
<a name="1744"><span class="lineNum"> 1744 </span> : : { _M_fill_insert(__position, __n, __x); }</a>
<a name="1745"><span class="lineNum"> 1745 </span> : : #endif</a>
<a name="1746"><span class="lineNum"> 1746 </span> : : </a>
<a name="1747"><span class="lineNum"> 1747 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1748"><span class="lineNum"> 1748 </span> : : /**</a>
<a name="1749"><span class="lineNum"> 1749 </span> : : * @brief Inserts a range into the %deque.</a>
<a name="1750"><span class="lineNum"> 1750 </span> : : * @param __position A const_iterator into the %deque.</a>
<a name="1751"><span class="lineNum"> 1751 </span> : : * @param __first An input iterator.</a>
<a name="1752"><span class="lineNum"> 1752 </span> : : * @param __last An input iterator.</a>
<a name="1753"><span class="lineNum"> 1753 </span> : : * @return An iterator that points to the inserted data.</a>
<a name="1754"><span class="lineNum"> 1754 </span> : : *</a>
<a name="1755"><span class="lineNum"> 1755 </span> : : * This function will insert copies of the data in the range</a>
<a name="1756"><span class="lineNum"> 1756 </span> : : * [__first,__last) into the %deque before the location specified</a>
<a name="1757"><span class="lineNum"> 1757 </span> : : * by @a __position. This is known as &lt;em&gt;range insert&lt;/em&gt;.</a>
<a name="1758"><span class="lineNum"> 1758 </span> : : */</a>
<a name="1759"><span class="lineNum"> 1759 </span> : : template&lt;typename _InputIterator,</a>
<a name="1760"><span class="lineNum"> 1760 </span> : : typename = std::_RequireInputIter&lt;_InputIterator&gt;&gt;</a>
<a name="1761"><span class="lineNum"> 1761 </span> : : iterator</a>
<a name="1762"><span class="lineNum"> 1762 </span> : : insert(const_iterator __position, _InputIterator __first,</a>
<a name="1763"><span class="lineNum"> 1763 </span> : : _InputIterator __last)</a>
<a name="1764"><span class="lineNum"> 1764 </span> : : {</a>
<a name="1765"><span class="lineNum"> 1765 </span> : : difference_type __offset = __position - cbegin();</a>
<a name="1766"><span class="lineNum"> 1766 </span> : : _M_insert_dispatch(__position._M_const_cast(),</a>
<a name="1767"><span class="lineNum"> 1767 </span> : : __first, __last, __false_type());</a>
<a name="1768"><span class="lineNum"> 1768 </span> : : return begin() + __offset;</a>
<a name="1769"><span class="lineNum"> 1769 </span> : : }</a>
<a name="1770"><span class="lineNum"> 1770 </span> : : #else</a>
<a name="1771"><span class="lineNum"> 1771 </span> : : /**</a>
<a name="1772"><span class="lineNum"> 1772 </span> : : * @brief Inserts a range into the %deque.</a>
<a name="1773"><span class="lineNum"> 1773 </span> : : * @param __position An iterator into the %deque.</a>
<a name="1774"><span class="lineNum"> 1774 </span> : : * @param __first An input iterator.</a>
<a name="1775"><span class="lineNum"> 1775 </span> : : * @param __last An input iterator.</a>
<a name="1776"><span class="lineNum"> 1776 </span> : : *</a>
<a name="1777"><span class="lineNum"> 1777 </span> : : * This function will insert copies of the data in the range</a>
<a name="1778"><span class="lineNum"> 1778 </span> : : * [__first,__last) into the %deque before the location specified</a>
<a name="1779"><span class="lineNum"> 1779 </span> : : * by @a __position. This is known as &lt;em&gt;range insert&lt;/em&gt;.</a>
<a name="1780"><span class="lineNum"> 1780 </span> : : */</a>
<a name="1781"><span class="lineNum"> 1781 </span> : : template&lt;typename _InputIterator&gt;</a>
<a name="1782"><span class="lineNum"> 1782 </span> : : void</a>
<a name="1783"><span class="lineNum"> 1783 </span> : : insert(iterator __position, _InputIterator __first,</a>
<a name="1784"><span class="lineNum"> 1784 </span> : : _InputIterator __last)</a>
<a name="1785"><span class="lineNum"> 1785 </span> : : {</a>
<a name="1786"><span class="lineNum"> 1786 </span> : : // Check whether it's an integral type. If so, it's not an iterator.</a>
<a name="1787"><span class="lineNum"> 1787 </span> : : typedef typename std::__is_integer&lt;_InputIterator&gt;::__type _Integral;</a>
<a name="1788"><span class="lineNum"> 1788 </span> : : _M_insert_dispatch(__position, __first, __last, _Integral());</a>
<a name="1789"><span class="lineNum"> 1789 </span> : : }</a>
<a name="1790"><span class="lineNum"> 1790 </span> : : #endif</a>
<a name="1791"><span class="lineNum"> 1791 </span> : : </a>
<a name="1792"><span class="lineNum"> 1792 </span> : : /**</a>
<a name="1793"><span class="lineNum"> 1793 </span> : : * @brief Remove element at given position.</a>
<a name="1794"><span class="lineNum"> 1794 </span> : : * @param __position Iterator pointing to element to be erased.</a>
<a name="1795"><span class="lineNum"> 1795 </span> : : * @return An iterator pointing to the next element (or end()).</a>
<a name="1796"><span class="lineNum"> 1796 </span> : : *</a>
<a name="1797"><span class="lineNum"> 1797 </span> : : * This function will erase the element at the given position and thus</a>
<a name="1798"><span class="lineNum"> 1798 </span> : : * shorten the %deque by one.</a>
<a name="1799"><span class="lineNum"> 1799 </span> : : *</a>
<a name="1800"><span class="lineNum"> 1800 </span> : : * The user is cautioned that</a>
<a name="1801"><span class="lineNum"> 1801 </span> : : * this function only erases the element, and that if the element is</a>
<a name="1802"><span class="lineNum"> 1802 </span> : : * itself a pointer, the pointed-to memory is not touched in any way.</a>
<a name="1803"><span class="lineNum"> 1803 </span> : : * Managing the pointer is the user's responsibility.</a>
<a name="1804"><span class="lineNum"> 1804 </span> : : */</a>
<a name="1805"><span class="lineNum"> 1805 </span> : : iterator</a>
<a name="1806"><span class="lineNum"> 1806 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1807"><span class="lineNum"> 1807 </span> : : erase(const_iterator __position)</a>
<a name="1808"><span class="lineNum"> 1808 </span> : : #else</a>
<a name="1809"><span class="lineNum"> 1809 </span> : : erase(iterator __position)</a>
<a name="1810"><span class="lineNum"> 1810 </span> : : #endif</a>
<a name="1811"><span class="lineNum"> 1811 </span> : : { return _M_erase(__position._M_const_cast()); }</a>
<a name="1812"><span class="lineNum"> 1812 </span> : : </a>
<a name="1813"><span class="lineNum"> 1813 </span> : : /**</a>
<a name="1814"><span class="lineNum"> 1814 </span> : : * @brief Remove a range of elements.</a>
<a name="1815"><span class="lineNum"> 1815 </span> : : * @param __first Iterator pointing to the first element to be erased.</a>
<a name="1816"><span class="lineNum"> 1816 </span> : : * @param __last Iterator pointing to one past the last element to be</a>
<a name="1817"><span class="lineNum"> 1817 </span> : : * erased.</a>
<a name="1818"><span class="lineNum"> 1818 </span> : : * @return An iterator pointing to the element pointed to by @a last</a>
<a name="1819"><span class="lineNum"> 1819 </span> : : * prior to erasing (or end()).</a>
<a name="1820"><span class="lineNum"> 1820 </span> : : *</a>
<a name="1821"><span class="lineNum"> 1821 </span> : : * This function will erase the elements in the range</a>
<a name="1822"><span class="lineNum"> 1822 </span> : : * [__first,__last) and shorten the %deque accordingly.</a>
<a name="1823"><span class="lineNum"> 1823 </span> : : *</a>
<a name="1824"><span class="lineNum"> 1824 </span> : : * The user is cautioned that</a>
<a name="1825"><span class="lineNum"> 1825 </span> : : * this function only erases the elements, and that if the elements</a>
<a name="1826"><span class="lineNum"> 1826 </span> : : * themselves are pointers, the pointed-to memory is not touched in any</a>
<a name="1827"><span class="lineNum"> 1827 </span> : : * way. Managing the pointer is the user's responsibility.</a>
<a name="1828"><span class="lineNum"> 1828 </span> : : */</a>
<a name="1829"><span class="lineNum"> 1829 </span> : : iterator</a>
<a name="1830"><span class="lineNum"> 1830 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1831"><span class="lineNum"> 1831 </span> : : erase(const_iterator __first, const_iterator __last)</a>
<a name="1832"><span class="lineNum"> 1832 </span> : : #else</a>
<a name="1833"><span class="lineNum"> 1833 </span> : : erase(iterator __first, iterator __last)</a>
<a name="1834"><span class="lineNum"> 1834 </span> : : #endif</a>
<a name="1835"><span class="lineNum"> 1835 </span> : : { return _M_erase(__first._M_const_cast(), __last._M_const_cast()); }</a>
<a name="1836"><span class="lineNum"> 1836 </span> : : </a>
<a name="1837"><span class="lineNum"> 1837 </span> : : /**</a>
<a name="1838"><span class="lineNum"> 1838 </span> : : * @brief Swaps data with another %deque.</a>
<a name="1839"><span class="lineNum"> 1839 </span> : : * @param __x A %deque of the same element and allocator types.</a>
<a name="1840"><span class="lineNum"> 1840 </span> : : *</a>
<a name="1841"><span class="lineNum"> 1841 </span> : : * This exchanges the elements between two deques in constant time.</a>
<a name="1842"><span class="lineNum"> 1842 </span> : : * (Four pointers, so it should be quite fast.)</a>
<a name="1843"><span class="lineNum"> 1843 </span> : : * Note that the global std::swap() function is specialized such that</a>
<a name="1844"><span class="lineNum"> 1844 </span> : : * std::swap(d1,d2) will feed to this function.</a>
<a name="1845"><span class="lineNum"> 1845 </span> : : *</a>
<a name="1846"><span class="lineNum"> 1846 </span> : : * Whether the allocators are swapped depends on the allocator traits.</a>
<a name="1847"><span class="lineNum"> 1847 </span> : : */</a>
<a name="1848"><span class="lineNum"> 1848 </span> : : void</a>
<a name="1849"><span class="lineNum"> 1849 </span> : : swap(deque&amp; __x) _GLIBCXX_NOEXCEPT</a>
<a name="1850"><span class="lineNum"> 1850 </span> : : {</a>
<a name="1851"><span class="lineNum"> 1851 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1852"><span class="lineNum"> 1852 </span> : : __glibcxx_assert(_Alloc_traits::propagate_on_container_swap::value</a>
<a name="1853"><span class="lineNum"> 1853 </span> : : || _M_get_Tp_allocator() == __x._M_get_Tp_allocator());</a>
<a name="1854"><span class="lineNum"> 1854 </span> : : #endif</a>
<a name="1855"><span class="lineNum"> 1855 </span> : : _M_impl._M_swap_data(__x._M_impl);</a>
<a name="1856"><span class="lineNum"> 1856 </span> : : _Alloc_traits::_S_on_swap(_M_get_Tp_allocator(),</a>
<a name="1857"><span class="lineNum"> 1857 </span> : : __x._M_get_Tp_allocator());</a>
<a name="1858"><span class="lineNum"> 1858 </span> : : }</a>
<a name="1859"><span class="lineNum"> 1859 </span> : : </a>
<a name="1860"><span class="lineNum"> 1860 </span> : : /**</a>
<a name="1861"><span class="lineNum"> 1861 </span> : : * Erases all the elements. Note that this function only erases the</a>
<a name="1862"><span class="lineNum"> 1862 </span> : : * elements, and that if the elements themselves are pointers, the</a>
<a name="1863"><span class="lineNum"> 1863 </span> : : * pointed-to memory is not touched in any way. Managing the pointer is</a>
<a name="1864"><span class="lineNum"> 1864 </span> : : * the user's responsibility.</a>
<a name="1865"><span class="lineNum"> 1865 </span> : : */</a>
<a name="1866"><span class="lineNum"> 1866 </span> : : void</a>
<a name="1867"><span class="lineNum"> 1867 </span> : : clear() _GLIBCXX_NOEXCEPT</a>
<a name="1868"><span class="lineNum"> 1868 </span> : : { _M_erase_at_end(begin()); }</a>
<a name="1869"><span class="lineNum"> 1869 </span> : : </a>
<a name="1870"><span class="lineNum"> 1870 </span> : : protected:</a>
<a name="1871"><span class="lineNum"> 1871 </span> : : // Internal constructor functions follow.</a>
<a name="1872"><span class="lineNum"> 1872 </span> : : </a>
<a name="1873"><span class="lineNum"> 1873 </span> : : // called by the range constructor to implement [23.1.1]/9</a>
<a name="1874"><span class="lineNum"> 1874 </span> : : </a>
<a name="1875"><span class="lineNum"> 1875 </span> : : // _GLIBCXX_RESOLVE_LIB_DEFECTS</a>
<a name="1876"><span class="lineNum"> 1876 </span> : : // 438. Ambiguity in the &quot;do the right thing&quot; clause</a>
<a name="1877"><span class="lineNum"> 1877 </span> : : template&lt;typename _Integer&gt;</a>
<a name="1878"><span class="lineNum"> 1878 </span> : : void</a>
<a name="1879"><span class="lineNum"> 1879 </span> : : _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)</a>
<a name="1880"><span class="lineNum"> 1880 </span> : : {</a>
<a name="1881"><span class="lineNum"> 1881 </span> : : _M_initialize_map(_S_check_init_len(static_cast&lt;size_type&gt;(__n),</a>
<a name="1882"><span class="lineNum"> 1882 </span> : : _M_get_Tp_allocator()));</a>
<a name="1883"><span class="lineNum"> 1883 </span> : : _M_fill_initialize(__x);</a>
<a name="1884"><span class="lineNum"> 1884 </span> : : }</a>
<a name="1885"><span class="lineNum"> 1885 </span> : : </a>
<a name="1886"><span class="lineNum"> 1886 </span> : : static size_t</a>
<a name="1887"><span class="lineNum"> 1887 </span> : : _S_check_init_len(size_t __n, const allocator_type&amp; __a)</a>
<a name="1888"><span class="lineNum"> 1888 </span> : : {</a>
<a name="1889"><span class="lineNum"> 1889 </span> : : if (__n &gt; _S_max_size(__a))</a>
<a name="1890"><span class="lineNum"> 1890 </span> : : __throw_length_error(</a>
<a name="1891"><span class="lineNum"> 1891 </span> : : __N(&quot;cannot create std::deque larger than max_size()&quot;));</a>
<a name="1892"><span class="lineNum"> 1892 </span> : : return __n;</a>
<a name="1893"><span class="lineNum"> 1893 </span> : : }</a>
<a name="1894"><span class="lineNum"> 1894 </span> : : </a>
<a name="1895"><span class="lineNum"> 1895 </span> : : static size_type</a>
<a name="1896"><span class="lineNum"> 1896 </span> :<span class="lineNoCov"> 0 : _S_max_size(const _Tp_alloc_type&amp; __a) _GLIBCXX_NOEXCEPT</span></a>
<a name="1897"><span class="lineNum"> 1897 </span> : : {</a>
<a name="1898"><span class="lineNum"> 1898 </span> :<span class="lineNoCov"> 0 : const size_t __diffmax = __gnu_cxx::__numeric_traits&lt;ptrdiff_t&gt;::__max;</span></a>
<a name="1899"><span class="lineNum"> 1899 </span> :<span class="lineNoCov"> 0 : const size_t __allocmax = _Alloc_traits::max_size(__a);</span></a>
<a name="1900"><span class="lineNum"> 1900 </span> :<span class="lineNoCov"> 0 : return (std::min)(__diffmax, __allocmax);</span></a>
<a name="1901"><span class="lineNum"> 1901 </span> : : }</a>
<a name="1902"><span class="lineNum"> 1902 </span> : : </a>
<a name="1903"><span class="lineNum"> 1903 </span> : : // called by the range constructor to implement [23.1.1]/9</a>
<a name="1904"><span class="lineNum"> 1904 </span> : : template&lt;typename _InputIterator&gt;</a>
<a name="1905"><span class="lineNum"> 1905 </span> : : void</a>
<a name="1906"><span class="lineNum"> 1906 </span> : : _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,</a>
<a name="1907"><span class="lineNum"> 1907 </span> : : __false_type)</a>
<a name="1908"><span class="lineNum"> 1908 </span> : : {</a>
<a name="1909"><span class="lineNum"> 1909 </span> : : _M_range_initialize(__first, __last,</a>
<a name="1910"><span class="lineNum"> 1910 </span> : : std::__iterator_category(__first));</a>
<a name="1911"><span class="lineNum"> 1911 </span> : : }</a>
<a name="1912"><span class="lineNum"> 1912 </span> : : </a>
<a name="1913"><span class="lineNum"> 1913 </span> : : // called by the second initialize_dispatch above</a>
<a name="1914"><span class="lineNum"> 1914 </span> : : ///@{</a>
<a name="1915"><span class="lineNum"> 1915 </span> : : /**</a>
<a name="1916"><span class="lineNum"> 1916 </span> : : * @brief Fills the deque with whatever is in [first,last).</a>
<a name="1917"><span class="lineNum"> 1917 </span> : : * @param __first An input iterator.</a>
<a name="1918"><span class="lineNum"> 1918 </span> : : * @param __last An input iterator.</a>
<a name="1919"><span class="lineNum"> 1919 </span> : : * @return Nothing.</a>
<a name="1920"><span class="lineNum"> 1920 </span> : : *</a>
<a name="1921"><span class="lineNum"> 1921 </span> : : * If the iterators are actually forward iterators (or better), then the</a>
<a name="1922"><span class="lineNum"> 1922 </span> : : * memory layout can be done all at once. Else we move forward using</a>
<a name="1923"><span class="lineNum"> 1923 </span> : : * push_back on each value from the iterator.</a>
<a name="1924"><span class="lineNum"> 1924 </span> : : */</a>
<a name="1925"><span class="lineNum"> 1925 </span> : : template&lt;typename _InputIterator&gt;</a>
<a name="1926"><span class="lineNum"> 1926 </span> : : void</a>
<a name="1927"><span class="lineNum"> 1927 </span> : : _M_range_initialize(_InputIterator __first, _InputIterator __last,</a>
<a name="1928"><span class="lineNum"> 1928 </span> : : std::input_iterator_tag);</a>
<a name="1929"><span class="lineNum"> 1929 </span> : : </a>
<a name="1930"><span class="lineNum"> 1930 </span> : : // called by the second initialize_dispatch above</a>
<a name="1931"><span class="lineNum"> 1931 </span> : : template&lt;typename _ForwardIterator&gt;</a>
<a name="1932"><span class="lineNum"> 1932 </span> : : void</a>
<a name="1933"><span class="lineNum"> 1933 </span> : : _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,</a>
<a name="1934"><span class="lineNum"> 1934 </span> : : std::forward_iterator_tag);</a>
<a name="1935"><span class="lineNum"> 1935 </span> : : ///@}</a>
<a name="1936"><span class="lineNum"> 1936 </span> : : </a>
<a name="1937"><span class="lineNum"> 1937 </span> : : /**</a>
<a name="1938"><span class="lineNum"> 1938 </span> : : * @brief Fills the %deque with copies of value.</a>
<a name="1939"><span class="lineNum"> 1939 </span> : : * @param __value Initial value.</a>
<a name="1940"><span class="lineNum"> 1940 </span> : : * @return Nothing.</a>
<a name="1941"><span class="lineNum"> 1941 </span> : : * @pre _M_start and _M_finish have already been initialized,</a>
<a name="1942"><span class="lineNum"> 1942 </span> : : * but none of the %deque's elements have yet been constructed.</a>
<a name="1943"><span class="lineNum"> 1943 </span> : : *</a>
<a name="1944"><span class="lineNum"> 1944 </span> : : * This function is called only when the user provides an explicit size</a>
<a name="1945"><span class="lineNum"> 1945 </span> : : * (with or without an explicit exemplar value).</a>
<a name="1946"><span class="lineNum"> 1946 </span> : : */</a>
<a name="1947"><span class="lineNum"> 1947 </span> : : void</a>
<a name="1948"><span class="lineNum"> 1948 </span> : : _M_fill_initialize(const value_type&amp; __value);</a>
<a name="1949"><span class="lineNum"> 1949 </span> : : </a>
<a name="1950"><span class="lineNum"> 1950 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="1951"><span class="lineNum"> 1951 </span> : : // called by deque(n).</a>
<a name="1952"><span class="lineNum"> 1952 </span> : : void</a>
<a name="1953"><span class="lineNum"> 1953 </span> : : _M_default_initialize();</a>
<a name="1954"><span class="lineNum"> 1954 </span> : : #endif</a>
<a name="1955"><span class="lineNum"> 1955 </span> : : </a>
<a name="1956"><span class="lineNum"> 1956 </span> : : // Internal assign functions follow. The *_aux functions do the actual</a>
<a name="1957"><span class="lineNum"> 1957 </span> : : // assignment work for the range versions.</a>
<a name="1958"><span class="lineNum"> 1958 </span> : : </a>
<a name="1959"><span class="lineNum"> 1959 </span> : : // called by the range assign to implement [23.1.1]/9</a>
<a name="1960"><span class="lineNum"> 1960 </span> : : </a>
<a name="1961"><span class="lineNum"> 1961 </span> : : // _GLIBCXX_RESOLVE_LIB_DEFECTS</a>
<a name="1962"><span class="lineNum"> 1962 </span> : : // 438. Ambiguity in the &quot;do the right thing&quot; clause</a>
<a name="1963"><span class="lineNum"> 1963 </span> : : template&lt;typename _Integer&gt;</a>
<a name="1964"><span class="lineNum"> 1964 </span> : : void</a>
<a name="1965"><span class="lineNum"> 1965 </span> : : _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)</a>
<a name="1966"><span class="lineNum"> 1966 </span> : : { _M_fill_assign(__n, __val); }</a>
<a name="1967"><span class="lineNum"> 1967 </span> : : </a>
<a name="1968"><span class="lineNum"> 1968 </span> : : // called by the range assign to implement [23.1.1]/9</a>
<a name="1969"><span class="lineNum"> 1969 </span> : : template&lt;typename _InputIterator&gt;</a>
<a name="1970"><span class="lineNum"> 1970 </span> : : void</a>
<a name="1971"><span class="lineNum"> 1971 </span> : : _M_assign_dispatch(_InputIterator __first, _InputIterator __last,</a>
<a name="1972"><span class="lineNum"> 1972 </span> : : __false_type)</a>
<a name="1973"><span class="lineNum"> 1973 </span> : : { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }</a>
<a name="1974"><span class="lineNum"> 1974 </span> : : </a>
<a name="1975"><span class="lineNum"> 1975 </span> : : // called by the second assign_dispatch above</a>
<a name="1976"><span class="lineNum"> 1976 </span> : : template&lt;typename _InputIterator&gt;</a>
<a name="1977"><span class="lineNum"> 1977 </span> : : void</a>
<a name="1978"><span class="lineNum"> 1978 </span> : : _M_assign_aux(_InputIterator __first, _InputIterator __last,</a>
<a name="1979"><span class="lineNum"> 1979 </span> : : std::input_iterator_tag);</a>
<a name="1980"><span class="lineNum"> 1980 </span> : : </a>
<a name="1981"><span class="lineNum"> 1981 </span> : : // called by the second assign_dispatch above</a>
<a name="1982"><span class="lineNum"> 1982 </span> : : template&lt;typename _ForwardIterator&gt;</a>
<a name="1983"><span class="lineNum"> 1983 </span> : : void</a>
<a name="1984"><span class="lineNum"> 1984 </span> : : _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,</a>
<a name="1985"><span class="lineNum"> 1985 </span> : : std::forward_iterator_tag)</a>
<a name="1986"><span class="lineNum"> 1986 </span> : : {</a>
<a name="1987"><span class="lineNum"> 1987 </span> : : const size_type __len = std::distance(__first, __last);</a>
<a name="1988"><span class="lineNum"> 1988 </span> : : if (__len &gt; size())</a>
<a name="1989"><span class="lineNum"> 1989 </span> : : {</a>
<a name="1990"><span class="lineNum"> 1990 </span> : : _ForwardIterator __mid = __first;</a>
<a name="1991"><span class="lineNum"> 1991 </span> : : std::advance(__mid, size());</a>
<a name="1992"><span class="lineNum"> 1992 </span> : : std::copy(__first, __mid, begin());</a>
<a name="1993"><span class="lineNum"> 1993 </span> : : _M_range_insert_aux(end(), __mid, __last,</a>
<a name="1994"><span class="lineNum"> 1994 </span> : : std::__iterator_category(__first));</a>
<a name="1995"><span class="lineNum"> 1995 </span> : : }</a>
<a name="1996"><span class="lineNum"> 1996 </span> : : else</a>
<a name="1997"><span class="lineNum"> 1997 </span> : : _M_erase_at_end(std::copy(__first, __last, begin()));</a>
<a name="1998"><span class="lineNum"> 1998 </span> : : }</a>
<a name="1999"><span class="lineNum"> 1999 </span> : : </a>
<a name="2000"><span class="lineNum"> 2000 </span> : : // Called by assign(n,t), and the range assign when it turns out</a>
<a name="2001"><span class="lineNum"> 2001 </span> : : // to be the same thing.</a>
<a name="2002"><span class="lineNum"> 2002 </span> : : void</a>
<a name="2003"><span class="lineNum"> 2003 </span> : : _M_fill_assign(size_type __n, const value_type&amp; __val)</a>
<a name="2004"><span class="lineNum"> 2004 </span> : : {</a>
<a name="2005"><span class="lineNum"> 2005 </span> : : if (__n &gt; size())</a>
<a name="2006"><span class="lineNum"> 2006 </span> : : {</a>
<a name="2007"><span class="lineNum"> 2007 </span> : : std::fill(begin(), end(), __val);</a>
<a name="2008"><span class="lineNum"> 2008 </span> : : _M_fill_insert(end(), __n - size(), __val);</a>
<a name="2009"><span class="lineNum"> 2009 </span> : : }</a>
<a name="2010"><span class="lineNum"> 2010 </span> : : else</a>
<a name="2011"><span class="lineNum"> 2011 </span> : : {</a>
<a name="2012"><span class="lineNum"> 2012 </span> : : _M_erase_at_end(begin() + difference_type(__n));</a>
<a name="2013"><span class="lineNum"> 2013 </span> : : std::fill(begin(), end(), __val);</a>
<a name="2014"><span class="lineNum"> 2014 </span> : : }</a>
<a name="2015"><span class="lineNum"> 2015 </span> : : }</a>
<a name="2016"><span class="lineNum"> 2016 </span> : : </a>
<a name="2017"><span class="lineNum"> 2017 </span> : : ///@{</a>
<a name="2018"><span class="lineNum"> 2018 </span> : : /// Helper functions for push_* and pop_*.</a>
<a name="2019"><span class="lineNum"> 2019 </span> : : #if __cplusplus &lt; 201103L</a>
<a name="2020"><span class="lineNum"> 2020 </span> : : void _M_push_back_aux(const value_type&amp;);</a>
<a name="2021"><span class="lineNum"> 2021 </span> : : </a>
<a name="2022"><span class="lineNum"> 2022 </span> : : void _M_push_front_aux(const value_type&amp;);</a>
<a name="2023"><span class="lineNum"> 2023 </span> : : #else</a>
<a name="2024"><span class="lineNum"> 2024 </span> : : template&lt;typename... _Args&gt;</a>
<a name="2025"><span class="lineNum"> 2025 </span> : : void _M_push_back_aux(_Args&amp;&amp;... __args);</a>
<a name="2026"><span class="lineNum"> 2026 </span> : : </a>
<a name="2027"><span class="lineNum"> 2027 </span> : : template&lt;typename... _Args&gt;</a>
<a name="2028"><span class="lineNum"> 2028 </span> : : void _M_push_front_aux(_Args&amp;&amp;... __args);</a>
<a name="2029"><span class="lineNum"> 2029 </span> : : #endif</a>
<a name="2030"><span class="lineNum"> 2030 </span> : : </a>
<a name="2031"><span class="lineNum"> 2031 </span> : : void _M_pop_back_aux();</a>
<a name="2032"><span class="lineNum"> 2032 </span> : : </a>
<a name="2033"><span class="lineNum"> 2033 </span> : : void _M_pop_front_aux();</a>
<a name="2034"><span class="lineNum"> 2034 </span> : : ///@}</a>
<a name="2035"><span class="lineNum"> 2035 </span> : : </a>
<a name="2036"><span class="lineNum"> 2036 </span> : : // Internal insert functions follow. The *_aux functions do the actual</a>
<a name="2037"><span class="lineNum"> 2037 </span> : : // insertion work when all shortcuts fail.</a>
<a name="2038"><span class="lineNum"> 2038 </span> : : </a>
<a name="2039"><span class="lineNum"> 2039 </span> : : // called by the range insert to implement [23.1.1]/9</a>
<a name="2040"><span class="lineNum"> 2040 </span> : : </a>
<a name="2041"><span class="lineNum"> 2041 </span> : : // _GLIBCXX_RESOLVE_LIB_DEFECTS</a>
<a name="2042"><span class="lineNum"> 2042 </span> : : // 438. Ambiguity in the &quot;do the right thing&quot; clause</a>
<a name="2043"><span class="lineNum"> 2043 </span> : : template&lt;typename _Integer&gt;</a>
<a name="2044"><span class="lineNum"> 2044 </span> : : void</a>
<a name="2045"><span class="lineNum"> 2045 </span> : : _M_insert_dispatch(iterator __pos,</a>
<a name="2046"><span class="lineNum"> 2046 </span> : : _Integer __n, _Integer __x, __true_type)</a>
<a name="2047"><span class="lineNum"> 2047 </span> : : { _M_fill_insert(__pos, __n, __x); }</a>
<a name="2048"><span class="lineNum"> 2048 </span> : : </a>
<a name="2049"><span class="lineNum"> 2049 </span> : : // called by the range insert to implement [23.1.1]/9</a>
<a name="2050"><span class="lineNum"> 2050 </span> : : template&lt;typename _InputIterator&gt;</a>
<a name="2051"><span class="lineNum"> 2051 </span> : : void</a>
<a name="2052"><span class="lineNum"> 2052 </span> : : _M_insert_dispatch(iterator __pos,</a>
<a name="2053"><span class="lineNum"> 2053 </span> : : _InputIterator __first, _InputIterator __last,</a>
<a name="2054"><span class="lineNum"> 2054 </span> : : __false_type)</a>
<a name="2055"><span class="lineNum"> 2055 </span> : : {</a>
<a name="2056"><span class="lineNum"> 2056 </span> : : _M_range_insert_aux(__pos, __first, __last,</a>
<a name="2057"><span class="lineNum"> 2057 </span> : : std::__iterator_category(__first));</a>
<a name="2058"><span class="lineNum"> 2058 </span> : : }</a>
<a name="2059"><span class="lineNum"> 2059 </span> : : </a>
<a name="2060"><span class="lineNum"> 2060 </span> : : // called by the second insert_dispatch above</a>
<a name="2061"><span class="lineNum"> 2061 </span> : : template&lt;typename _InputIterator&gt;</a>
<a name="2062"><span class="lineNum"> 2062 </span> : : void</a>
<a name="2063"><span class="lineNum"> 2063 </span> : : _M_range_insert_aux(iterator __pos, _InputIterator __first,</a>
<a name="2064"><span class="lineNum"> 2064 </span> : : _InputIterator __last, std::input_iterator_tag);</a>
<a name="2065"><span class="lineNum"> 2065 </span> : : </a>
<a name="2066"><span class="lineNum"> 2066 </span> : : // called by the second insert_dispatch above</a>
<a name="2067"><span class="lineNum"> 2067 </span> : : template&lt;typename _ForwardIterator&gt;</a>
<a name="2068"><span class="lineNum"> 2068 </span> : : void</a>
<a name="2069"><span class="lineNum"> 2069 </span> : : _M_range_insert_aux(iterator __pos, _ForwardIterator __first,</a>
<a name="2070"><span class="lineNum"> 2070 </span> : : _ForwardIterator __last, std::forward_iterator_tag);</a>
<a name="2071"><span class="lineNum"> 2071 </span> : : </a>
<a name="2072"><span class="lineNum"> 2072 </span> : : // Called by insert(p,n,x), and the range insert when it turns out to be</a>
<a name="2073"><span class="lineNum"> 2073 </span> : : // the same thing. Can use fill functions in optimal situations,</a>
<a name="2074"><span class="lineNum"> 2074 </span> : : // otherwise passes off to insert_aux(p,n,x).</a>
<a name="2075"><span class="lineNum"> 2075 </span> : : void</a>
<a name="2076"><span class="lineNum"> 2076 </span> : : _M_fill_insert(iterator __pos, size_type __n, const value_type&amp; __x);</a>
<a name="2077"><span class="lineNum"> 2077 </span> : : </a>
<a name="2078"><span class="lineNum"> 2078 </span> : : // called by insert(p,x)</a>
<a name="2079"><span class="lineNum"> 2079 </span> : : #if __cplusplus &lt; 201103L</a>
<a name="2080"><span class="lineNum"> 2080 </span> : : iterator</a>
<a name="2081"><span class="lineNum"> 2081 </span> : : _M_insert_aux(iterator __pos, const value_type&amp; __x);</a>
<a name="2082"><span class="lineNum"> 2082 </span> : : #else</a>
<a name="2083"><span class="lineNum"> 2083 </span> : : template&lt;typename... _Args&gt;</a>
<a name="2084"><span class="lineNum"> 2084 </span> : : iterator</a>
<a name="2085"><span class="lineNum"> 2085 </span> : : _M_insert_aux(iterator __pos, _Args&amp;&amp;... __args);</a>
<a name="2086"><span class="lineNum"> 2086 </span> : : #endif</a>
<a name="2087"><span class="lineNum"> 2087 </span> : : </a>
<a name="2088"><span class="lineNum"> 2088 </span> : : // called by insert(p,n,x) via fill_insert</a>
<a name="2089"><span class="lineNum"> 2089 </span> : : void</a>
<a name="2090"><span class="lineNum"> 2090 </span> : : _M_insert_aux(iterator __pos, size_type __n, const value_type&amp; __x);</a>
<a name="2091"><span class="lineNum"> 2091 </span> : : </a>
<a name="2092"><span class="lineNum"> 2092 </span> : : // called by range_insert_aux for forward iterators</a>
<a name="2093"><span class="lineNum"> 2093 </span> : : template&lt;typename _ForwardIterator&gt;</a>
<a name="2094"><span class="lineNum"> 2094 </span> : : void</a>
<a name="2095"><span class="lineNum"> 2095 </span> : : _M_insert_aux(iterator __pos,</a>
<a name="2096"><span class="lineNum"> 2096 </span> : : _ForwardIterator __first, _ForwardIterator __last,</a>
<a name="2097"><span class="lineNum"> 2097 </span> : : size_type __n);</a>
<a name="2098"><span class="lineNum"> 2098 </span> : : </a>
<a name="2099"><span class="lineNum"> 2099 </span> : : </a>
<a name="2100"><span class="lineNum"> 2100 </span> : : // Internal erase functions follow.</a>
<a name="2101"><span class="lineNum"> 2101 </span> : : </a>
<a name="2102"><span class="lineNum"> 2102 </span> : : void</a>
<a name="2103"><span class="lineNum"> 2103 </span> : : _M_destroy_data_aux(iterator __first, iterator __last);</a>
<a name="2104"><span class="lineNum"> 2104 </span> : : </a>
<a name="2105"><span class="lineNum"> 2105 </span> : : // Called by ~deque().</a>
<a name="2106"><span class="lineNum"> 2106 </span> : : // NB: Doesn't deallocate the nodes.</a>
<a name="2107"><span class="lineNum"> 2107 </span> : : template&lt;typename _Alloc1&gt;</a>
<a name="2108"><span class="lineNum"> 2108 </span> : : void</a>
<a name="2109"><span class="lineNum"> 2109 </span> : : _M_destroy_data(iterator __first, iterator __last, const _Alloc1&amp;)</a>
<a name="2110"><span class="lineNum"> 2110 </span> : : { _M_destroy_data_aux(__first, __last); }</a>
<a name="2111"><span class="lineNum"> 2111 </span> : : </a>
<a name="2112"><span class="lineNum"> 2112 </span> : : void</a>
<a name="2113"><span class="lineNum"> 2113 </span> :<span class="lineCov"> 1 : _M_destroy_data(iterator __first, iterator __last,</span></a>
<a name="2114"><span class="lineNum"> 2114 </span> : : const std::allocator&lt;_Tp&gt;&amp;)</a>
<a name="2115"><span class="lineNum"> 2115 </span> : : {</a>
<a name="2116"><span class="lineNum"> 2116 </span> : : if (!__has_trivial_destructor(value_type))</a>
<a name="2117"><span class="lineNum"> 2117 </span> : : _M_destroy_data_aux(__first, __last);</a>
<a name="2118"><span class="lineNum"> 2118 </span> :<span class="lineCov"> 1 : }</span></a>
<a name="2119"><span class="lineNum"> 2119 </span> : : </a>
<a name="2120"><span class="lineNum"> 2120 </span> : : // Called by erase(q1, q2).</a>
<a name="2121"><span class="lineNum"> 2121 </span> : : void</a>
<a name="2122"><span class="lineNum"> 2122 </span> : : _M_erase_at_begin(iterator __pos)</a>
<a name="2123"><span class="lineNum"> 2123 </span> : : {</a>
<a name="2124"><span class="lineNum"> 2124 </span> : : _M_destroy_data(begin(), __pos, _M_get_Tp_allocator());</a>
<a name="2125"><span class="lineNum"> 2125 </span> : : _M_destroy_nodes(this-&gt;_M_impl._M_start._M_node, __pos._M_node);</a>
<a name="2126"><span class="lineNum"> 2126 </span> : : this-&gt;_M_impl._M_start = __pos;</a>
<a name="2127"><span class="lineNum"> 2127 </span> : : }</a>
<a name="2128"><span class="lineNum"> 2128 </span> : : </a>
<a name="2129"><span class="lineNum"> 2129 </span> : : // Called by erase(q1, q2), resize(), clear(), _M_assign_aux,</a>
<a name="2130"><span class="lineNum"> 2130 </span> : : // _M_fill_assign, operator=.</a>
<a name="2131"><span class="lineNum"> 2131 </span> : : void</a>
<a name="2132"><span class="lineNum"> 2132 </span> : : _M_erase_at_end(iterator __pos)</a>
<a name="2133"><span class="lineNum"> 2133 </span> : : {</a>
<a name="2134"><span class="lineNum"> 2134 </span> : : _M_destroy_data(__pos, end(), _M_get_Tp_allocator());</a>
<a name="2135"><span class="lineNum"> 2135 </span> : : _M_destroy_nodes(__pos._M_node + 1,</a>
<a name="2136"><span class="lineNum"> 2136 </span> : : this-&gt;_M_impl._M_finish._M_node + 1);</a>
<a name="2137"><span class="lineNum"> 2137 </span> : : this-&gt;_M_impl._M_finish = __pos;</a>
<a name="2138"><span class="lineNum"> 2138 </span> : : }</a>
<a name="2139"><span class="lineNum"> 2139 </span> : : </a>
<a name="2140"><span class="lineNum"> 2140 </span> : : iterator</a>
<a name="2141"><span class="lineNum"> 2141 </span> : : _M_erase(iterator __pos);</a>
<a name="2142"><span class="lineNum"> 2142 </span> : : </a>
<a name="2143"><span class="lineNum"> 2143 </span> : : iterator</a>
<a name="2144"><span class="lineNum"> 2144 </span> : : _M_erase(iterator __first, iterator __last);</a>
<a name="2145"><span class="lineNum"> 2145 </span> : : </a>
<a name="2146"><span class="lineNum"> 2146 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="2147"><span class="lineNum"> 2147 </span> : : // Called by resize(sz).</a>
<a name="2148"><span class="lineNum"> 2148 </span> : : void</a>
<a name="2149"><span class="lineNum"> 2149 </span> : : _M_default_append(size_type __n);</a>
<a name="2150"><span class="lineNum"> 2150 </span> : : </a>
<a name="2151"><span class="lineNum"> 2151 </span> : : bool</a>
<a name="2152"><span class="lineNum"> 2152 </span> : : _M_shrink_to_fit();</a>
<a name="2153"><span class="lineNum"> 2153 </span> : : #endif</a>
<a name="2154"><span class="lineNum"> 2154 </span> : : </a>
<a name="2155"><span class="lineNum"> 2155 </span> : : ///@{</a>
<a name="2156"><span class="lineNum"> 2156 </span> : : /// Memory-handling helpers for the previous internal insert functions.</a>
<a name="2157"><span class="lineNum"> 2157 </span> : : iterator</a>
<a name="2158"><span class="lineNum"> 2158 </span> : : _M_reserve_elements_at_front(size_type __n)</a>
<a name="2159"><span class="lineNum"> 2159 </span> : : {</a>
<a name="2160"><span class="lineNum"> 2160 </span> : : const size_type __vacancies = this-&gt;_M_impl._M_start._M_cur</a>
<a name="2161"><span class="lineNum"> 2161 </span> : : - this-&gt;_M_impl._M_start._M_first;</a>
<a name="2162"><span class="lineNum"> 2162 </span> : : if (__n &gt; __vacancies)</a>
<a name="2163"><span class="lineNum"> 2163 </span> : : _M_new_elements_at_front(__n - __vacancies);</a>
<a name="2164"><span class="lineNum"> 2164 </span> : : return this-&gt;_M_impl._M_start - difference_type(__n);</a>
<a name="2165"><span class="lineNum"> 2165 </span> : : }</a>
<a name="2166"><span class="lineNum"> 2166 </span> : : </a>
<a name="2167"><span class="lineNum"> 2167 </span> : : iterator</a>
<a name="2168"><span class="lineNum"> 2168 </span> : : _M_reserve_elements_at_back(size_type __n)</a>
<a name="2169"><span class="lineNum"> 2169 </span> : : {</a>
<a name="2170"><span class="lineNum"> 2170 </span> : : const size_type __vacancies = (this-&gt;_M_impl._M_finish._M_last</a>
<a name="2171"><span class="lineNum"> 2171 </span> : : - this-&gt;_M_impl._M_finish._M_cur) - 1;</a>
<a name="2172"><span class="lineNum"> 2172 </span> : : if (__n &gt; __vacancies)</a>
<a name="2173"><span class="lineNum"> 2173 </span> : : _M_new_elements_at_back(__n - __vacancies);</a>
<a name="2174"><span class="lineNum"> 2174 </span> : : return this-&gt;_M_impl._M_finish + difference_type(__n);</a>
<a name="2175"><span class="lineNum"> 2175 </span> : : }</a>
<a name="2176"><span class="lineNum"> 2176 </span> : : </a>
<a name="2177"><span class="lineNum"> 2177 </span> : : void</a>
<a name="2178"><span class="lineNum"> 2178 </span> : : _M_new_elements_at_front(size_type __new_elements);</a>
<a name="2179"><span class="lineNum"> 2179 </span> : : </a>
<a name="2180"><span class="lineNum"> 2180 </span> : : void</a>
<a name="2181"><span class="lineNum"> 2181 </span> : : _M_new_elements_at_back(size_type __new_elements);</a>
<a name="2182"><span class="lineNum"> 2182 </span> : : ///@}</a>
<a name="2183"><span class="lineNum"> 2183 </span> : : </a>
<a name="2184"><span class="lineNum"> 2184 </span> : : </a>
<a name="2185"><span class="lineNum"> 2185 </span> : : ///@{</a>
<a name="2186"><span class="lineNum"> 2186 </span> : : /**</a>
<a name="2187"><span class="lineNum"> 2187 </span> : : * @brief Memory-handling helpers for the major %map.</a>
<a name="2188"><span class="lineNum"> 2188 </span> : : *</a>
<a name="2189"><span class="lineNum"> 2189 </span> : : * Makes sure the _M_map has space for new nodes. Does not</a>
<a name="2190"><span class="lineNum"> 2190 </span> : : * actually add the nodes. Can invalidate _M_map pointers.</a>
<a name="2191"><span class="lineNum"> 2191 </span> : : * (And consequently, %deque iterators.)</a>
<a name="2192"><span class="lineNum"> 2192 </span> : : */</a>
<a name="2193"><span class="lineNum"> 2193 </span> : : void</a>
<a name="2194"><span class="lineNum"> 2194 </span> :<span class="lineNoCov"> 0 : _M_reserve_map_at_back(size_type __nodes_to_add = 1)</span></a>
<a name="2195"><span class="lineNum"> 2195 </span> : : {</a>
<a name="2196"><span class="lineNum"> 2196 </span> :<span class="lineNoCov"> 0 : if (__nodes_to_add + 1 &gt; this-&gt;_M_impl._M_map_size</span></a>
<a name="2197"><span class="lineNum"> 2197 </span> [<span class="branchNoExec" title="Branch 0 was not executed"> # </span><span class="branchNoExec" title="Branch 1 was not executed"> # </span>]:<span class="lineNoCov"> 0 : - (this-&gt;_M_impl._M_finish._M_node - this-&gt;_M_impl._M_map))</span></a>
<a name="2198"><span class="lineNum"> 2198 </span> :<span class="lineNoCov"> 0 : _M_reallocate_map(__nodes_to_add, false);</span></a>
<a name="2199"><span class="lineNum"> 2199 </span> :<span class="lineNoCov"> 0 : }</span></a>
<a name="2200"><span class="lineNum"> 2200 </span> : : </a>
<a name="2201"><span class="lineNum"> 2201 </span> : : void</a>
<a name="2202"><span class="lineNum"> 2202 </span> : : _M_reserve_map_at_front(size_type __nodes_to_add = 1)</a>
<a name="2203"><span class="lineNum"> 2203 </span> : : {</a>
<a name="2204"><span class="lineNum"> 2204 </span> : : if (__nodes_to_add &gt; size_type(this-&gt;_M_impl._M_start._M_node</a>
<a name="2205"><span class="lineNum"> 2205 </span> : : - this-&gt;_M_impl._M_map))</a>
<a name="2206"><span class="lineNum"> 2206 </span> : : _M_reallocate_map(__nodes_to_add, true);</a>
<a name="2207"><span class="lineNum"> 2207 </span> : : }</a>
<a name="2208"><span class="lineNum"> 2208 </span> : : </a>
<a name="2209"><span class="lineNum"> 2209 </span> : : void</a>
<a name="2210"><span class="lineNum"> 2210 </span> : : _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front);</a>
<a name="2211"><span class="lineNum"> 2211 </span> : : ///@}</a>
<a name="2212"><span class="lineNum"> 2212 </span> : : </a>
<a name="2213"><span class="lineNum"> 2213 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="2214"><span class="lineNum"> 2214 </span> : : // Constant-time, nothrow move assignment when source object's memory</a>
<a name="2215"><span class="lineNum"> 2215 </span> : : // can be moved because the allocators are equal.</a>
<a name="2216"><span class="lineNum"> 2216 </span> : : void</a>
<a name="2217"><span class="lineNum"> 2217 </span> : : _M_move_assign1(deque&amp;&amp; __x, /* always equal: */ true_type) noexcept</a>
<a name="2218"><span class="lineNum"> 2218 </span> : : {</a>
<a name="2219"><span class="lineNum"> 2219 </span> : : this-&gt;_M_impl._M_swap_data(__x._M_impl);</a>
<a name="2220"><span class="lineNum"> 2220 </span> : : __x.clear();</a>
<a name="2221"><span class="lineNum"> 2221 </span> : : std::__alloc_on_move(_M_get_Tp_allocator(), __x._M_get_Tp_allocator());</a>
<a name="2222"><span class="lineNum"> 2222 </span> : : }</a>
<a name="2223"><span class="lineNum"> 2223 </span> : : </a>
<a name="2224"><span class="lineNum"> 2224 </span> : : // When the allocators are not equal the operation could throw, because</a>
<a name="2225"><span class="lineNum"> 2225 </span> : : // we might need to allocate a new map for __x after moving from it</a>
<a name="2226"><span class="lineNum"> 2226 </span> : : // or we might need to allocate new elements for *this.</a>
<a name="2227"><span class="lineNum"> 2227 </span> : : void</a>
<a name="2228"><span class="lineNum"> 2228 </span> : : _M_move_assign1(deque&amp;&amp; __x, /* always equal: */ false_type)</a>
<a name="2229"><span class="lineNum"> 2229 </span> : : {</a>
<a name="2230"><span class="lineNum"> 2230 </span> : : constexpr bool __move_storage =</a>
<a name="2231"><span class="lineNum"> 2231 </span> : : _Alloc_traits::_S_propagate_on_move_assign();</a>
<a name="2232"><span class="lineNum"> 2232 </span> : : _M_move_assign2(std::move(__x), __bool_constant&lt;__move_storage&gt;());</a>
<a name="2233"><span class="lineNum"> 2233 </span> : : }</a>
<a name="2234"><span class="lineNum"> 2234 </span> : : </a>
<a name="2235"><span class="lineNum"> 2235 </span> : : // Destroy all elements and deallocate all memory, then replace</a>
<a name="2236"><span class="lineNum"> 2236 </span> : : // with elements created from __args.</a>
<a name="2237"><span class="lineNum"> 2237 </span> : : template&lt;typename... _Args&gt;</a>
<a name="2238"><span class="lineNum"> 2238 </span> : : void</a>
<a name="2239"><span class="lineNum"> 2239 </span> : : _M_replace_map(_Args&amp;&amp;... __args)</a>
<a name="2240"><span class="lineNum"> 2240 </span> : : {</a>
<a name="2241"><span class="lineNum"> 2241 </span> : : // Create new data first, so if allocation fails there are no effects.</a>
<a name="2242"><span class="lineNum"> 2242 </span> : : deque __newobj(std::forward&lt;_Args&gt;(__args)...);</a>
<a name="2243"><span class="lineNum"> 2243 </span> : : // Free existing storage using existing allocator.</a>
<a name="2244"><span class="lineNum"> 2244 </span> : : clear();</a>
<a name="2245"><span class="lineNum"> 2245 </span> : : _M_deallocate_node(*begin()._M_node); // one node left after clear()</a>
<a name="2246"><span class="lineNum"> 2246 </span> : : _M_deallocate_map(this-&gt;_M_impl._M_map, this-&gt;_M_impl._M_map_size);</a>
<a name="2247"><span class="lineNum"> 2247 </span> : : this-&gt;_M_impl._M_map = nullptr;</a>
<a name="2248"><span class="lineNum"> 2248 </span> : : this-&gt;_M_impl._M_map_size = 0;</a>
<a name="2249"><span class="lineNum"> 2249 </span> : : // Take ownership of replacement memory.</a>
<a name="2250"><span class="lineNum"> 2250 </span> : : this-&gt;_M_impl._M_swap_data(__newobj._M_impl);</a>
<a name="2251"><span class="lineNum"> 2251 </span> : : }</a>
<a name="2252"><span class="lineNum"> 2252 </span> : : </a>
<a name="2253"><span class="lineNum"> 2253 </span> : : // Do move assignment when the allocator propagates.</a>
<a name="2254"><span class="lineNum"> 2254 </span> : : void</a>
<a name="2255"><span class="lineNum"> 2255 </span> : : _M_move_assign2(deque&amp;&amp; __x, /* propagate: */ true_type)</a>
<a name="2256"><span class="lineNum"> 2256 </span> : : {</a>
<a name="2257"><span class="lineNum"> 2257 </span> : : // Make a copy of the original allocator state.</a>
<a name="2258"><span class="lineNum"> 2258 </span> : : auto __alloc = __x._M_get_Tp_allocator();</a>
<a name="2259"><span class="lineNum"> 2259 </span> : : // The allocator propagates so storage can be moved from __x,</a>
<a name="2260"><span class="lineNum"> 2260 </span> : : // leaving __x in a valid empty state with a moved-from allocator.</a>
<a name="2261"><span class="lineNum"> 2261 </span> : : _M_replace_map(std::move(__x));</a>
<a name="2262"><span class="lineNum"> 2262 </span> : : // Move the corresponding allocator state too.</a>
<a name="2263"><span class="lineNum"> 2263 </span> : : _M_get_Tp_allocator() = std::move(__alloc);</a>
<a name="2264"><span class="lineNum"> 2264 </span> : : }</a>
<a name="2265"><span class="lineNum"> 2265 </span> : : </a>
<a name="2266"><span class="lineNum"> 2266 </span> : : // Do move assignment when it may not be possible to move source</a>
<a name="2267"><span class="lineNum"> 2267 </span> : : // object's memory, resulting in a linear-time operation.</a>
<a name="2268"><span class="lineNum"> 2268 </span> : : void</a>
<a name="2269"><span class="lineNum"> 2269 </span> : : _M_move_assign2(deque&amp;&amp; __x, /* propagate: */ false_type)</a>
<a name="2270"><span class="lineNum"> 2270 </span> : : {</a>
<a name="2271"><span class="lineNum"> 2271 </span> : : if (__x._M_get_Tp_allocator() == this-&gt;_M_get_Tp_allocator())</a>
<a name="2272"><span class="lineNum"> 2272 </span> : : {</a>
<a name="2273"><span class="lineNum"> 2273 </span> : : // The allocators are equal so storage can be moved from __x,</a>
<a name="2274"><span class="lineNum"> 2274 </span> : : // leaving __x in a valid empty state with its current allocator.</a>
<a name="2275"><span class="lineNum"> 2275 </span> : : _M_replace_map(std::move(__x), __x.get_allocator());</a>
<a name="2276"><span class="lineNum"> 2276 </span> : : }</a>
<a name="2277"><span class="lineNum"> 2277 </span> : : else</a>
<a name="2278"><span class="lineNum"> 2278 </span> : : {</a>
<a name="2279"><span class="lineNum"> 2279 </span> : : // The rvalue's allocator cannot be moved and is not equal,</a>
<a name="2280"><span class="lineNum"> 2280 </span> : : // so we need to individually move each element.</a>
<a name="2281"><span class="lineNum"> 2281 </span> : : _M_assign_aux(std::__make_move_if_noexcept_iterator(__x.begin()),</a>
<a name="2282"><span class="lineNum"> 2282 </span> : : std::__make_move_if_noexcept_iterator(__x.end()),</a>
<a name="2283"><span class="lineNum"> 2283 </span> : : std::random_access_iterator_tag());</a>
<a name="2284"><span class="lineNum"> 2284 </span> : : __x.clear();</a>
<a name="2285"><span class="lineNum"> 2285 </span> : : }</a>
<a name="2286"><span class="lineNum"> 2286 </span> : : }</a>
<a name="2287"><span class="lineNum"> 2287 </span> : : #endif</a>
<a name="2288"><span class="lineNum"> 2288 </span> : : };</a>
<a name="2289"><span class="lineNum"> 2289 </span> : : </a>
<a name="2290"><span class="lineNum"> 2290 </span> : : #if __cpp_deduction_guides &gt;= 201606</a>
<a name="2291"><span class="lineNum"> 2291 </span> : : template&lt;typename _InputIterator, typename _ValT</a>
<a name="2292"><span class="lineNum"> 2292 </span> : : = typename iterator_traits&lt;_InputIterator&gt;::value_type,</a>
<a name="2293"><span class="lineNum"> 2293 </span> : : typename _Allocator = allocator&lt;_ValT&gt;,</a>
<a name="2294"><span class="lineNum"> 2294 </span> : : typename = _RequireInputIter&lt;_InputIterator&gt;,</a>
<a name="2295"><span class="lineNum"> 2295 </span> : : typename = _RequireAllocator&lt;_Allocator&gt;&gt;</a>
<a name="2296"><span class="lineNum"> 2296 </span> : : deque(_InputIterator, _InputIterator, _Allocator = _Allocator())</a>
<a name="2297"><span class="lineNum"> 2297 </span> : : -&gt; deque&lt;_ValT, _Allocator&gt;;</a>
<a name="2298"><span class="lineNum"> 2298 </span> : : #endif</a>
<a name="2299"><span class="lineNum"> 2299 </span> : : </a>
<a name="2300"><span class="lineNum"> 2300 </span> : : /**</a>
<a name="2301"><span class="lineNum"> 2301 </span> : : * @brief Deque equality comparison.</a>
<a name="2302"><span class="lineNum"> 2302 </span> : : * @param __x A %deque.</a>
<a name="2303"><span class="lineNum"> 2303 </span> : : * @param __y A %deque of the same type as @a __x.</a>
<a name="2304"><span class="lineNum"> 2304 </span> : : * @return True iff the size and elements of the deques are equal.</a>
<a name="2305"><span class="lineNum"> 2305 </span> : : *</a>
<a name="2306"><span class="lineNum"> 2306 </span> : : * This is an equivalence relation. It is linear in the size of the</a>
<a name="2307"><span class="lineNum"> 2307 </span> : : * deques. Deques are considered equivalent if their sizes are equal,</a>
<a name="2308"><span class="lineNum"> 2308 </span> : : * and if corresponding elements compare equal.</a>
<a name="2309"><span class="lineNum"> 2309 </span> : : */</a>
<a name="2310"><span class="lineNum"> 2310 </span> : : template&lt;typename _Tp, typename _Alloc&gt;</a>
<a name="2311"><span class="lineNum"> 2311 </span> : : inline bool</a>
<a name="2312"><span class="lineNum"> 2312 </span> : : operator==(const deque&lt;_Tp, _Alloc&gt;&amp; __x,</a>
<a name="2313"><span class="lineNum"> 2313 </span> : : const deque&lt;_Tp, _Alloc&gt;&amp; __y)</a>
<a name="2314"><span class="lineNum"> 2314 </span> : : { return __x.size() == __y.size()</a>
<a name="2315"><span class="lineNum"> 2315 </span> : : &amp;&amp; std::equal(__x.begin(), __x.end(), __y.begin()); }</a>
<a name="2316"><span class="lineNum"> 2316 </span> : : </a>
<a name="2317"><span class="lineNum"> 2317 </span> : : /**</a>
<a name="2318"><span class="lineNum"> 2318 </span> : : * @brief Deque ordering relation.</a>
<a name="2319"><span class="lineNum"> 2319 </span> : : * @param __x A %deque.</a>
<a name="2320"><span class="lineNum"> 2320 </span> : : * @param __y A %deque of the same type as @a __x.</a>
<a name="2321"><span class="lineNum"> 2321 </span> : : * @return True iff @a x is lexicographically less than @a __y.</a>
<a name="2322"><span class="lineNum"> 2322 </span> : : *</a>
<a name="2323"><span class="lineNum"> 2323 </span> : : * This is a total ordering relation. It is linear in the size of the</a>
<a name="2324"><span class="lineNum"> 2324 </span> : : * deques. The elements must be comparable with @c &lt;.</a>
<a name="2325"><span class="lineNum"> 2325 </span> : : *</a>
<a name="2326"><span class="lineNum"> 2326 </span> : : * See std::lexicographical_compare() for how the determination is made.</a>
<a name="2327"><span class="lineNum"> 2327 </span> : : */</a>
<a name="2328"><span class="lineNum"> 2328 </span> : : template&lt;typename _Tp, typename _Alloc&gt;</a>
<a name="2329"><span class="lineNum"> 2329 </span> : : inline bool</a>
<a name="2330"><span class="lineNum"> 2330 </span> : : operator&lt;(const deque&lt;_Tp, _Alloc&gt;&amp; __x,</a>
<a name="2331"><span class="lineNum"> 2331 </span> : : const deque&lt;_Tp, _Alloc&gt;&amp; __y)</a>
<a name="2332"><span class="lineNum"> 2332 </span> : : { return std::lexicographical_compare(__x.begin(), __x.end(),</a>
<a name="2333"><span class="lineNum"> 2333 </span> : : __y.begin(), __y.end()); }</a>
<a name="2334"><span class="lineNum"> 2334 </span> : : </a>
<a name="2335"><span class="lineNum"> 2335 </span> : : /// Based on operator==</a>
<a name="2336"><span class="lineNum"> 2336 </span> : : template&lt;typename _Tp, typename _Alloc&gt;</a>
<a name="2337"><span class="lineNum"> 2337 </span> : : inline bool</a>
<a name="2338"><span class="lineNum"> 2338 </span> : : operator!=(const deque&lt;_Tp, _Alloc&gt;&amp; __x,</a>
<a name="2339"><span class="lineNum"> 2339 </span> : : const deque&lt;_Tp, _Alloc&gt;&amp; __y)</a>
<a name="2340"><span class="lineNum"> 2340 </span> : : { return !(__x == __y); }</a>
<a name="2341"><span class="lineNum"> 2341 </span> : : </a>
<a name="2342"><span class="lineNum"> 2342 </span> : : /// Based on operator&lt;</a>
<a name="2343"><span class="lineNum"> 2343 </span> : : template&lt;typename _Tp, typename _Alloc&gt;</a>
<a name="2344"><span class="lineNum"> 2344 </span> : : inline bool</a>
<a name="2345"><span class="lineNum"> 2345 </span> : : operator&gt;(const deque&lt;_Tp, _Alloc&gt;&amp; __x,</a>
<a name="2346"><span class="lineNum"> 2346 </span> : : const deque&lt;_Tp, _Alloc&gt;&amp; __y)</a>
<a name="2347"><span class="lineNum"> 2347 </span> : : { return __y &lt; __x; }</a>
<a name="2348"><span class="lineNum"> 2348 </span> : : </a>
<a name="2349"><span class="lineNum"> 2349 </span> : : /// Based on operator&lt;</a>
<a name="2350"><span class="lineNum"> 2350 </span> : : template&lt;typename _Tp, typename _Alloc&gt;</a>
<a name="2351"><span class="lineNum"> 2351 </span> : : inline bool</a>
<a name="2352"><span class="lineNum"> 2352 </span> : : operator&lt;=(const deque&lt;_Tp, _Alloc&gt;&amp; __x,</a>
<a name="2353"><span class="lineNum"> 2353 </span> : : const deque&lt;_Tp, _Alloc&gt;&amp; __y)</a>
<a name="2354"><span class="lineNum"> 2354 </span> : : { return !(__y &lt; __x); }</a>
<a name="2355"><span class="lineNum"> 2355 </span> : : </a>
<a name="2356"><span class="lineNum"> 2356 </span> : : /// Based on operator&lt;</a>
<a name="2357"><span class="lineNum"> 2357 </span> : : template&lt;typename _Tp, typename _Alloc&gt;</a>
<a name="2358"><span class="lineNum"> 2358 </span> : : inline bool</a>
<a name="2359"><span class="lineNum"> 2359 </span> : : operator&gt;=(const deque&lt;_Tp, _Alloc&gt;&amp; __x,</a>
<a name="2360"><span class="lineNum"> 2360 </span> : : const deque&lt;_Tp, _Alloc&gt;&amp; __y)</a>
<a name="2361"><span class="lineNum"> 2361 </span> : : { return !(__x &lt; __y); }</a>
<a name="2362"><span class="lineNum"> 2362 </span> : : </a>
<a name="2363"><span class="lineNum"> 2363 </span> : : /// See std::deque::swap().</a>
<a name="2364"><span class="lineNum"> 2364 </span> : : template&lt;typename _Tp, typename _Alloc&gt;</a>
<a name="2365"><span class="lineNum"> 2365 </span> : : inline void</a>
<a name="2366"><span class="lineNum"> 2366 </span> : : swap(deque&lt;_Tp,_Alloc&gt;&amp; __x, deque&lt;_Tp,_Alloc&gt;&amp; __y)</a>
<a name="2367"><span class="lineNum"> 2367 </span> : : _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))</a>
<a name="2368"><span class="lineNum"> 2368 </span> : : { __x.swap(__y); }</a>
<a name="2369"><span class="lineNum"> 2369 </span> : : </a>
<a name="2370"><span class="lineNum"> 2370 </span> : : #undef _GLIBCXX_DEQUE_BUF_SIZE</a>
<a name="2371"><span class="lineNum"> 2371 </span> : : </a>
<a name="2372"><span class="lineNum"> 2372 </span> : : _GLIBCXX_END_NAMESPACE_CONTAINER</a>
<a name="2373"><span class="lineNum"> 2373 </span> : : </a>
<a name="2374"><span class="lineNum"> 2374 </span> : : #if __cplusplus &gt;= 201103L</a>
<a name="2375"><span class="lineNum"> 2375 </span> : : // std::allocator is safe, but it is not the only allocator</a>
<a name="2376"><span class="lineNum"> 2376 </span> : : // for which this is valid.</a>
<a name="2377"><span class="lineNum"> 2377 </span> : : template&lt;class _Tp&gt;</a>
<a name="2378"><span class="lineNum"> 2378 </span> : : struct __is_bitwise_relocatable&lt;_GLIBCXX_STD_C::deque&lt;_Tp&gt;&gt;</a>
<a name="2379"><span class="lineNum"> 2379 </span> : : : true_type { };</a>
<a name="2380"><span class="lineNum"> 2380 </span> : : #endif</a>
<a name="2381"><span class="lineNum"> 2381 </span> : : </a>
<a name="2382"><span class="lineNum"> 2382 </span> : : _GLIBCXX_END_NAMESPACE_VERSION</a>
<a name="2383"><span class="lineNum"> 2383 </span> : : } // namespace std</a>
<a name="2384"><span class="lineNum"> 2384 </span> : : </a>
<a name="2385"><span class="lineNum"> 2385 </span> : : #endif /* _STL_DEQUE_H */</a>
</pre>
</td>
</tr>
</table>
<br>
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
<tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.14</a></td></tr>
</table>
<br>
</body>
</html>