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.
465 lines
48 KiB
465 lines
48 KiB
<!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_stack.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_stack.h<span style="font-size: 80%;"> (source / <a href="stl_stack.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">11</td>
|
|
<td class="headerCovTableEntry">13</td>
|
|
<td class="headerCovTableEntryMed">84.6 %</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">5</td>
|
|
<td class="headerCovTableEntry">6</td>
|
|
<td class="headerCovTableEntryMed">83.3 %</td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td class="headerItem">Branches:</td>
|
|
<td class="headerCovTableEntry">0</td>
|
|
<td class="headerCovTableEntry">0</td>
|
|
<td class="headerCovTableEntryHi">-</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> : : // Stack 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> : : // <http://www.gnu.org/licenses/>.</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 "as is" 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) 1996,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 "as is" 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_stack.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{stack}</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_STACK_H</a>
|
|
<a name="57"><span class="lineNum"> 57 </span> : : #define _STL_STACK_H 1</a>
|
|
<a name="58"><span class="lineNum"> 58 </span> : : </a>
|
|
<a name="59"><span class="lineNum"> 59 </span> : : #include <bits/concept_check.h></a>
|
|
<a name="60"><span class="lineNum"> 60 </span> : : #include <debug/debug.h></a>
|
|
<a name="61"><span class="lineNum"> 61 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="62"><span class="lineNum"> 62 </span> : : # include <bits/uses_allocator.h></a>
|
|
<a name="63"><span class="lineNum"> 63 </span> : : #endif</a>
|
|
<a name="64"><span class="lineNum"> 64 </span> : : </a>
|
|
<a name="65"><span class="lineNum"> 65 </span> : : namespace std _GLIBCXX_VISIBILITY(default)</a>
|
|
<a name="66"><span class="lineNum"> 66 </span> : : {</a>
|
|
<a name="67"><span class="lineNum"> 67 </span> : : _GLIBCXX_BEGIN_NAMESPACE_VERSION</a>
|
|
<a name="68"><span class="lineNum"> 68 </span> : : </a>
|
|
<a name="69"><span class="lineNum"> 69 </span> : : /**</a>
|
|
<a name="70"><span class="lineNum"> 70 </span> : : * @brief A standard container giving FILO behavior.</a>
|
|
<a name="71"><span class="lineNum"> 71 </span> : : *</a>
|
|
<a name="72"><span class="lineNum"> 72 </span> : : * @ingroup sequences</a>
|
|
<a name="73"><span class="lineNum"> 73 </span> : : *</a>
|
|
<a name="74"><span class="lineNum"> 74 </span> : : * @tparam _Tp Type of element.</a>
|
|
<a name="75"><span class="lineNum"> 75 </span> : : * @tparam _Sequence Type of underlying sequence, defaults to deque<_Tp>.</a>
|
|
<a name="76"><span class="lineNum"> 76 </span> : : *</a>
|
|
<a name="77"><span class="lineNum"> 77 </span> : : * Meets many of the requirements of a</a>
|
|
<a name="78"><span class="lineNum"> 78 </span> : : * <a href="tables.html#65">container</a>,</a>
|
|
<a name="79"><span class="lineNum"> 79 </span> : : * but does not define anything to do with iterators. Very few of the</a>
|
|
<a name="80"><span class="lineNum"> 80 </span> : : * other standard container interfaces are defined.</a>
|
|
<a name="81"><span class="lineNum"> 81 </span> : : *</a>
|
|
<a name="82"><span class="lineNum"> 82 </span> : : * This is not a true container, but an @e adaptor. It holds</a>
|
|
<a name="83"><span class="lineNum"> 83 </span> : : * another container, and provides a wrapper interface to that</a>
|
|
<a name="84"><span class="lineNum"> 84 </span> : : * container. The wrapper is what enforces strict</a>
|
|
<a name="85"><span class="lineNum"> 85 </span> : : * first-in-last-out %stack behavior.</a>
|
|
<a name="86"><span class="lineNum"> 86 </span> : : *</a>
|
|
<a name="87"><span class="lineNum"> 87 </span> : : * The second template parameter defines the type of the underlying</a>
|
|
<a name="88"><span class="lineNum"> 88 </span> : : * sequence/container. It defaults to std::deque, but it can be</a>
|
|
<a name="89"><span class="lineNum"> 89 </span> : : * any type that supports @c back, @c push_back, and @c pop_back,</a>
|
|
<a name="90"><span class="lineNum"> 90 </span> : : * such as std::list, std::vector, or an appropriate user-defined</a>
|
|
<a name="91"><span class="lineNum"> 91 </span> : : * type.</a>
|
|
<a name="92"><span class="lineNum"> 92 </span> : : *</a>
|
|
<a name="93"><span class="lineNum"> 93 </span> : : * Members not found in @a normal containers are @c container_type,</a>
|
|
<a name="94"><span class="lineNum"> 94 </span> : : * which is a typedef for the second Sequence parameter, and @c</a>
|
|
<a name="95"><span class="lineNum"> 95 </span> : : * push, @c pop, and @c top, which are standard %stack/FILO</a>
|
|
<a name="96"><span class="lineNum"> 96 </span> : : * operations.</a>
|
|
<a name="97"><span class="lineNum"> 97 </span> : : */</a>
|
|
<a name="98"><span class="lineNum"> 98 </span> : : template<typename _Tp, typename _Sequence = deque<_Tp> ></a>
|
|
<a name="99"><span class="lineNum"> 99 </span> : : class stack</a>
|
|
<a name="100"><span class="lineNum"> 100 </span> : : {</a>
|
|
<a name="101"><span class="lineNum"> 101 </span> : : #ifdef _GLIBCXX_CONCEPT_CHECKS</a>
|
|
<a name="102"><span class="lineNum"> 102 </span> : : // concept requirements</a>
|
|
<a name="103"><span class="lineNum"> 103 </span> : : typedef typename _Sequence::value_type _Sequence_value_type;</a>
|
|
<a name="104"><span class="lineNum"> 104 </span> : : # if __cplusplus < 201103L</a>
|
|
<a name="105"><span class="lineNum"> 105 </span> : : __glibcxx_class_requires(_Tp, _SGIAssignableConcept)</a>
|
|
<a name="106"><span class="lineNum"> 106 </span> : : __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)</a>
|
|
<a name="107"><span class="lineNum"> 107 </span> : : # endif</a>
|
|
<a name="108"><span class="lineNum"> 108 </span> : : __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)</a>
|
|
<a name="109"><span class="lineNum"> 109 </span> : : #endif</a>
|
|
<a name="110"><span class="lineNum"> 110 </span> : : </a>
|
|
<a name="111"><span class="lineNum"> 111 </span> : : template<typename _Tp1, typename _Seq1></a>
|
|
<a name="112"><span class="lineNum"> 112 </span> : : friend bool</a>
|
|
<a name="113"><span class="lineNum"> 113 </span> : : operator==(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);</a>
|
|
<a name="114"><span class="lineNum"> 114 </span> : : </a>
|
|
<a name="115"><span class="lineNum"> 115 </span> : : template<typename _Tp1, typename _Seq1></a>
|
|
<a name="116"><span class="lineNum"> 116 </span> : : friend bool</a>
|
|
<a name="117"><span class="lineNum"> 117 </span> : : operator<(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);</a>
|
|
<a name="118"><span class="lineNum"> 118 </span> : : </a>
|
|
<a name="119"><span class="lineNum"> 119 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="120"><span class="lineNum"> 120 </span> : : template<typename _Alloc></a>
|
|
<a name="121"><span class="lineNum"> 121 </span> : : using _Uses = typename</a>
|
|
<a name="122"><span class="lineNum"> 122 </span> : : enable_if<uses_allocator<_Sequence, _Alloc>::value>::type;</a>
|
|
<a name="123"><span class="lineNum"> 123 </span> : : </a>
|
|
<a name="124"><span class="lineNum"> 124 </span> : : #if __cplusplus >= 201703L</a>
|
|
<a name="125"><span class="lineNum"> 125 </span> : : // _GLIBCXX_RESOLVE_LIB_DEFECTS</a>
|
|
<a name="126"><span class="lineNum"> 126 </span> : : // 2566. Requirements on the first template parameter of container</a>
|
|
<a name="127"><span class="lineNum"> 127 </span> : : // adaptors</a>
|
|
<a name="128"><span class="lineNum"> 128 </span> : : static_assert(is_same<_Tp, typename _Sequence::value_type>::value,</a>
|
|
<a name="129"><span class="lineNum"> 129 </span> : : "value_type must be the same as the underlying container");</a>
|
|
<a name="130"><span class="lineNum"> 130 </span> : : #endif // C++17</a>
|
|
<a name="131"><span class="lineNum"> 131 </span> : : #endif // C++11</a>
|
|
<a name="132"><span class="lineNum"> 132 </span> : : </a>
|
|
<a name="133"><span class="lineNum"> 133 </span> : : public:</a>
|
|
<a name="134"><span class="lineNum"> 134 </span> : : typedef typename _Sequence::value_type value_type;</a>
|
|
<a name="135"><span class="lineNum"> 135 </span> : : typedef typename _Sequence::reference reference;</a>
|
|
<a name="136"><span class="lineNum"> 136 </span> : : typedef typename _Sequence::const_reference const_reference;</a>
|
|
<a name="137"><span class="lineNum"> 137 </span> : : typedef typename _Sequence::size_type size_type;</a>
|
|
<a name="138"><span class="lineNum"> 138 </span> : : typedef _Sequence container_type;</a>
|
|
<a name="139"><span class="lineNum"> 139 </span> : : </a>
|
|
<a name="140"><span class="lineNum"> 140 </span> : : protected:</a>
|
|
<a name="141"><span class="lineNum"> 141 </span> : : // See queue::c for notes on this name.</a>
|
|
<a name="142"><span class="lineNum"> 142 </span> : : _Sequence c;</a>
|
|
<a name="143"><span class="lineNum"> 143 </span> : : </a>
|
|
<a name="144"><span class="lineNum"> 144 </span> : : public:</a>
|
|
<a name="145"><span class="lineNum"> 145 </span> : : // XXX removed old def ctor, added def arg to this one to match 14882</a>
|
|
<a name="146"><span class="lineNum"> 146 </span> : : /**</a>
|
|
<a name="147"><span class="lineNum"> 147 </span> : : * @brief Default constructor creates no elements.</a>
|
|
<a name="148"><span class="lineNum"> 148 </span> : : */</a>
|
|
<a name="149"><span class="lineNum"> 149 </span> : : #if __cplusplus < 201103L</a>
|
|
<a name="150"><span class="lineNum"> 150 </span> : : explicit</a>
|
|
<a name="151"><span class="lineNum"> 151 </span> : : stack(const _Sequence& __c = _Sequence())</a>
|
|
<a name="152"><span class="lineNum"> 152 </span> : : : c(__c) { }</a>
|
|
<a name="153"><span class="lineNum"> 153 </span> : : #else</a>
|
|
<a name="154"><span class="lineNum"> 154 </span> : : template<typename _Seq = _Sequence, typename _Requires = typename</a>
|
|
<a name="155"><span class="lineNum"> 155 </span> : : enable_if<is_default_constructible<_Seq>::value>::type></a>
|
|
<a name="156"><span class="lineNum"> 156 </span> :<span class="lineCov"> 1 : stack()</span></a>
|
|
<a name="157"><span class="lineNum"> 157 </span> :<span class="lineCov"> 1 : : c() { }</span></a>
|
|
<a name="158"><span class="lineNum"> 158 </span> : : </a>
|
|
<a name="159"><span class="lineNum"> 159 </span> : : explicit</a>
|
|
<a name="160"><span class="lineNum"> 160 </span> : : stack(const _Sequence& __c)</a>
|
|
<a name="161"><span class="lineNum"> 161 </span> : : : c(__c) { }</a>
|
|
<a name="162"><span class="lineNum"> 162 </span> : : </a>
|
|
<a name="163"><span class="lineNum"> 163 </span> : : explicit</a>
|
|
<a name="164"><span class="lineNum"> 164 </span> : : stack(_Sequence&& __c)</a>
|
|
<a name="165"><span class="lineNum"> 165 </span> : : : c(std::move(__c)) { }</a>
|
|
<a name="166"><span class="lineNum"> 166 </span> : : </a>
|
|
<a name="167"><span class="lineNum"> 167 </span> : : template<typename _Alloc, typename _Requires = _Uses<_Alloc>></a>
|
|
<a name="168"><span class="lineNum"> 168 </span> : : explicit</a>
|
|
<a name="169"><span class="lineNum"> 169 </span> : : stack(const _Alloc& __a)</a>
|
|
<a name="170"><span class="lineNum"> 170 </span> : : : c(__a) { }</a>
|
|
<a name="171"><span class="lineNum"> 171 </span> : : </a>
|
|
<a name="172"><span class="lineNum"> 172 </span> : : template<typename _Alloc, typename _Requires = _Uses<_Alloc>></a>
|
|
<a name="173"><span class="lineNum"> 173 </span> : : stack(const _Sequence& __c, const _Alloc& __a)</a>
|
|
<a name="174"><span class="lineNum"> 174 </span> : : : c(__c, __a) { }</a>
|
|
<a name="175"><span class="lineNum"> 175 </span> : : </a>
|
|
<a name="176"><span class="lineNum"> 176 </span> : : template<typename _Alloc, typename _Requires = _Uses<_Alloc>></a>
|
|
<a name="177"><span class="lineNum"> 177 </span> : : stack(_Sequence&& __c, const _Alloc& __a)</a>
|
|
<a name="178"><span class="lineNum"> 178 </span> : : : c(std::move(__c), __a) { }</a>
|
|
<a name="179"><span class="lineNum"> 179 </span> : : </a>
|
|
<a name="180"><span class="lineNum"> 180 </span> : : template<typename _Alloc, typename _Requires = _Uses<_Alloc>></a>
|
|
<a name="181"><span class="lineNum"> 181 </span> : : stack(const stack& __q, const _Alloc& __a)</a>
|
|
<a name="182"><span class="lineNum"> 182 </span> : : : c(__q.c, __a) { }</a>
|
|
<a name="183"><span class="lineNum"> 183 </span> : : </a>
|
|
<a name="184"><span class="lineNum"> 184 </span> : : template<typename _Alloc, typename _Requires = _Uses<_Alloc>></a>
|
|
<a name="185"><span class="lineNum"> 185 </span> : : stack(stack&& __q, const _Alloc& __a)</a>
|
|
<a name="186"><span class="lineNum"> 186 </span> : : : c(std::move(__q.c), __a) { }</a>
|
|
<a name="187"><span class="lineNum"> 187 </span> : : #endif</a>
|
|
<a name="188"><span class="lineNum"> 188 </span> : : </a>
|
|
<a name="189"><span class="lineNum"> 189 </span> : : /**</a>
|
|
<a name="190"><span class="lineNum"> 190 </span> : : * Returns true if the %stack is empty.</a>
|
|
<a name="191"><span class="lineNum"> 191 </span> : : */</a>
|
|
<a name="192"><span class="lineNum"> 192 </span> : : _GLIBCXX_NODISCARD bool</a>
|
|
<a name="193"><span class="lineNum"> 193 </span> :<span class="lineCov"> 4 : empty() const</span></a>
|
|
<a name="194"><span class="lineNum"> 194 </span> :<span class="lineCov"> 4 : { return c.empty(); }</span></a>
|
|
<a name="195"><span class="lineNum"> 195 </span> : : </a>
|
|
<a name="196"><span class="lineNum"> 196 </span> : : /** Returns the number of elements in the %stack. */</a>
|
|
<a name="197"><span class="lineNum"> 197 </span> : : size_type</a>
|
|
<a name="198"><span class="lineNum"> 198 </span> : : size() const</a>
|
|
<a name="199"><span class="lineNum"> 199 </span> : : { return c.size(); }</a>
|
|
<a name="200"><span class="lineNum"> 200 </span> : : </a>
|
|
<a name="201"><span class="lineNum"> 201 </span> : : /**</a>
|
|
<a name="202"><span class="lineNum"> 202 </span> : : * Returns a read/write reference to the data at the first</a>
|
|
<a name="203"><span class="lineNum"> 203 </span> : : * element of the %stack.</a>
|
|
<a name="204"><span class="lineNum"> 204 </span> : : */</a>
|
|
<a name="205"><span class="lineNum"> 205 </span> : : reference</a>
|
|
<a name="206"><span class="lineNum"> 206 </span> :<span class="lineCov"> 3 : top()</span></a>
|
|
<a name="207"><span class="lineNum"> 207 </span> : : {</a>
|
|
<a name="208"><span class="lineNum"> 208 </span> : : __glibcxx_requires_nonempty();</a>
|
|
<a name="209"><span class="lineNum"> 209 </span> :<span class="lineCov"> 3 : return c.back();</span></a>
|
|
<a name="210"><span class="lineNum"> 210 </span> : : }</a>
|
|
<a name="211"><span class="lineNum"> 211 </span> : : </a>
|
|
<a name="212"><span class="lineNum"> 212 </span> : : /**</a>
|
|
<a name="213"><span class="lineNum"> 213 </span> : : * Returns a read-only (constant) reference to the data at the first</a>
|
|
<a name="214"><span class="lineNum"> 214 </span> : : * element of the %stack.</a>
|
|
<a name="215"><span class="lineNum"> 215 </span> : : */</a>
|
|
<a name="216"><span class="lineNum"> 216 </span> : : const_reference</a>
|
|
<a name="217"><span class="lineNum"> 217 </span> : : top() const</a>
|
|
<a name="218"><span class="lineNum"> 218 </span> : : {</a>
|
|
<a name="219"><span class="lineNum"> 219 </span> : : __glibcxx_requires_nonempty();</a>
|
|
<a name="220"><span class="lineNum"> 220 </span> : : return c.back();</a>
|
|
<a name="221"><span class="lineNum"> 221 </span> : : }</a>
|
|
<a name="222"><span class="lineNum"> 222 </span> : : </a>
|
|
<a name="223"><span class="lineNum"> 223 </span> : : /**</a>
|
|
<a name="224"><span class="lineNum"> 224 </span> : : * @brief Add data to the top of the %stack.</a>
|
|
<a name="225"><span class="lineNum"> 225 </span> : : * @param __x Data to be added.</a>
|
|
<a name="226"><span class="lineNum"> 226 </span> : : *</a>
|
|
<a name="227"><span class="lineNum"> 227 </span> : : * This is a typical %stack operation. The function creates an</a>
|
|
<a name="228"><span class="lineNum"> 228 </span> : : * element at the top of the %stack and assigns the given data</a>
|
|
<a name="229"><span class="lineNum"> 229 </span> : : * to it. The time complexity of the operation depends on the</a>
|
|
<a name="230"><span class="lineNum"> 230 </span> : : * underlying sequence.</a>
|
|
<a name="231"><span class="lineNum"> 231 </span> : : */</a>
|
|
<a name="232"><span class="lineNum"> 232 </span> : : void</a>
|
|
<a name="233"><span class="lineNum"> 233 </span> :<span class="lineNoCov"> 0 : push(const value_type& __x)</span></a>
|
|
<a name="234"><span class="lineNum"> 234 </span> :<span class="lineNoCov"> 0 : { c.push_back(__x); }</span></a>
|
|
<a name="235"><span class="lineNum"> 235 </span> : : </a>
|
|
<a name="236"><span class="lineNum"> 236 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="237"><span class="lineNum"> 237 </span> : : void</a>
|
|
<a name="238"><span class="lineNum"> 238 </span> :<span class="lineCov"> 3 : push(value_type&& __x)</span></a>
|
|
<a name="239"><span class="lineNum"> 239 </span> :<span class="lineCov"> 3 : { c.push_back(std::move(__x)); }</span></a>
|
|
<a name="240"><span class="lineNum"> 240 </span> : : </a>
|
|
<a name="241"><span class="lineNum"> 241 </span> : : #if __cplusplus > 201402L</a>
|
|
<a name="242"><span class="lineNum"> 242 </span> : : template<typename... _Args></a>
|
|
<a name="243"><span class="lineNum"> 243 </span> : : decltype(auto)</a>
|
|
<a name="244"><span class="lineNum"> 244 </span> : : emplace(_Args&&... __args)</a>
|
|
<a name="245"><span class="lineNum"> 245 </span> : : { return c.emplace_back(std::forward<_Args>(__args)...); }</a>
|
|
<a name="246"><span class="lineNum"> 246 </span> : : #else</a>
|
|
<a name="247"><span class="lineNum"> 247 </span> : : template<typename... _Args></a>
|
|
<a name="248"><span class="lineNum"> 248 </span> : : void</a>
|
|
<a name="249"><span class="lineNum"> 249 </span> : : emplace(_Args&&... __args)</a>
|
|
<a name="250"><span class="lineNum"> 250 </span> : : { c.emplace_back(std::forward<_Args>(__args)...); }</a>
|
|
<a name="251"><span class="lineNum"> 251 </span> : : #endif</a>
|
|
<a name="252"><span class="lineNum"> 252 </span> : : #endif</a>
|
|
<a name="253"><span class="lineNum"> 253 </span> : : </a>
|
|
<a name="254"><span class="lineNum"> 254 </span> : : /**</a>
|
|
<a name="255"><span class="lineNum"> 255 </span> : : * @brief Removes first element.</a>
|
|
<a name="256"><span class="lineNum"> 256 </span> : : *</a>
|
|
<a name="257"><span class="lineNum"> 257 </span> : : * This is a typical %stack operation. It shrinks the %stack</a>
|
|
<a name="258"><span class="lineNum"> 258 </span> : : * by one. The time complexity of the operation depends on the</a>
|
|
<a name="259"><span class="lineNum"> 259 </span> : : * underlying sequence.</a>
|
|
<a name="260"><span class="lineNum"> 260 </span> : : *</a>
|
|
<a name="261"><span class="lineNum"> 261 </span> : : * Note that no data is returned, and if the first element's</a>
|
|
<a name="262"><span class="lineNum"> 262 </span> : : * data is needed, it should be retrieved before pop() is</a>
|
|
<a name="263"><span class="lineNum"> 263 </span> : : * called.</a>
|
|
<a name="264"><span class="lineNum"> 264 </span> : : */</a>
|
|
<a name="265"><span class="lineNum"> 265 </span> : : void</a>
|
|
<a name="266"><span class="lineNum"> 266 </span> :<span class="lineCov"> 2 : pop()</span></a>
|
|
<a name="267"><span class="lineNum"> 267 </span> : : {</a>
|
|
<a name="268"><span class="lineNum"> 268 </span> : : __glibcxx_requires_nonempty();</a>
|
|
<a name="269"><span class="lineNum"> 269 </span> :<span class="lineCov"> 2 : c.pop_back();</span></a>
|
|
<a name="270"><span class="lineNum"> 270 </span> :<span class="lineCov"> 2 : }</span></a>
|
|
<a name="271"><span class="lineNum"> 271 </span> : : </a>
|
|
<a name="272"><span class="lineNum"> 272 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="273"><span class="lineNum"> 273 </span> : : void</a>
|
|
<a name="274"><span class="lineNum"> 274 </span> : : swap(stack& __s)</a>
|
|
<a name="275"><span class="lineNum"> 275 </span> : : #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11</a>
|
|
<a name="276"><span class="lineNum"> 276 </span> : : noexcept(__is_nothrow_swappable<_Sequence>::value)</a>
|
|
<a name="277"><span class="lineNum"> 277 </span> : : #else</a>
|
|
<a name="278"><span class="lineNum"> 278 </span> : : noexcept(__is_nothrow_swappable<_Tp>::value)</a>
|
|
<a name="279"><span class="lineNum"> 279 </span> : : #endif</a>
|
|
<a name="280"><span class="lineNum"> 280 </span> : : {</a>
|
|
<a name="281"><span class="lineNum"> 281 </span> : : using std::swap;</a>
|
|
<a name="282"><span class="lineNum"> 282 </span> : : swap(c, __s.c);</a>
|
|
<a name="283"><span class="lineNum"> 283 </span> : : }</a>
|
|
<a name="284"><span class="lineNum"> 284 </span> : : #endif // __cplusplus >= 201103L</a>
|
|
<a name="285"><span class="lineNum"> 285 </span> : : };</a>
|
|
<a name="286"><span class="lineNum"> 286 </span> : : </a>
|
|
<a name="287"><span class="lineNum"> 287 </span> : : #if __cpp_deduction_guides >= 201606</a>
|
|
<a name="288"><span class="lineNum"> 288 </span> : : template<typename _Container,</a>
|
|
<a name="289"><span class="lineNum"> 289 </span> : : typename = _RequireNotAllocator<_Container>></a>
|
|
<a name="290"><span class="lineNum"> 290 </span> : : stack(_Container) -> stack<typename _Container::value_type, _Container>;</a>
|
|
<a name="291"><span class="lineNum"> 291 </span> : : </a>
|
|
<a name="292"><span class="lineNum"> 292 </span> : : template<typename _Container, typename _Allocator,</a>
|
|
<a name="293"><span class="lineNum"> 293 </span> : : typename = _RequireNotAllocator<_Container>,</a>
|
|
<a name="294"><span class="lineNum"> 294 </span> : : typename = _RequireAllocator<_Allocator>></a>
|
|
<a name="295"><span class="lineNum"> 295 </span> : : stack(_Container, _Allocator)</a>
|
|
<a name="296"><span class="lineNum"> 296 </span> : : -> stack<typename _Container::value_type, _Container>;</a>
|
|
<a name="297"><span class="lineNum"> 297 </span> : : #endif</a>
|
|
<a name="298"><span class="lineNum"> 298 </span> : : </a>
|
|
<a name="299"><span class="lineNum"> 299 </span> : : /**</a>
|
|
<a name="300"><span class="lineNum"> 300 </span> : : * @brief Stack equality comparison.</a>
|
|
<a name="301"><span class="lineNum"> 301 </span> : : * @param __x A %stack.</a>
|
|
<a name="302"><span class="lineNum"> 302 </span> : : * @param __y A %stack of the same type as @a __x.</a>
|
|
<a name="303"><span class="lineNum"> 303 </span> : : * @return True iff the size and elements of the stacks are equal.</a>
|
|
<a name="304"><span class="lineNum"> 304 </span> : : *</a>
|
|
<a name="305"><span class="lineNum"> 305 </span> : : * This is an equivalence relation. Complexity and semantics</a>
|
|
<a name="306"><span class="lineNum"> 306 </span> : : * depend on the underlying sequence type, but the expected rules</a>
|
|
<a name="307"><span class="lineNum"> 307 </span> : : * are: this relation is linear in the size of the sequences, and</a>
|
|
<a name="308"><span class="lineNum"> 308 </span> : : * stacks are considered equivalent if their sequences compare</a>
|
|
<a name="309"><span class="lineNum"> 309 </span> : : * equal.</a>
|
|
<a name="310"><span class="lineNum"> 310 </span> : : */</a>
|
|
<a name="311"><span class="lineNum"> 311 </span> : : template<typename _Tp, typename _Seq></a>
|
|
<a name="312"><span class="lineNum"> 312 </span> : : inline bool</a>
|
|
<a name="313"><span class="lineNum"> 313 </span> : : operator==(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)</a>
|
|
<a name="314"><span class="lineNum"> 314 </span> : : { return __x.c == __y.c; }</a>
|
|
<a name="315"><span class="lineNum"> 315 </span> : : </a>
|
|
<a name="316"><span class="lineNum"> 316 </span> : : /**</a>
|
|
<a name="317"><span class="lineNum"> 317 </span> : : * @brief Stack ordering relation.</a>
|
|
<a name="318"><span class="lineNum"> 318 </span> : : * @param __x A %stack.</a>
|
|
<a name="319"><span class="lineNum"> 319 </span> : : * @param __y A %stack of the same type as @a x.</a>
|
|
<a name="320"><span class="lineNum"> 320 </span> : : * @return True iff @a x is lexicographically less than @a __y.</a>
|
|
<a name="321"><span class="lineNum"> 321 </span> : : *</a>
|
|
<a name="322"><span class="lineNum"> 322 </span> : : * This is an total ordering relation. Complexity and semantics</a>
|
|
<a name="323"><span class="lineNum"> 323 </span> : : * depend on the underlying sequence type, but the expected rules</a>
|
|
<a name="324"><span class="lineNum"> 324 </span> : : * are: this relation is linear in the size of the sequences, the</a>
|
|
<a name="325"><span class="lineNum"> 325 </span> : : * elements must be comparable with @c <, and</a>
|
|
<a name="326"><span class="lineNum"> 326 </span> : : * std::lexicographical_compare() is usually used to make the</a>
|
|
<a name="327"><span class="lineNum"> 327 </span> : : * determination.</a>
|
|
<a name="328"><span class="lineNum"> 328 </span> : : */</a>
|
|
<a name="329"><span class="lineNum"> 329 </span> : : template<typename _Tp, typename _Seq></a>
|
|
<a name="330"><span class="lineNum"> 330 </span> : : inline bool</a>
|
|
<a name="331"><span class="lineNum"> 331 </span> : : operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)</a>
|
|
<a name="332"><span class="lineNum"> 332 </span> : : { return __x.c < __y.c; }</a>
|
|
<a name="333"><span class="lineNum"> 333 </span> : : </a>
|
|
<a name="334"><span class="lineNum"> 334 </span> : : /// Based on operator==</a>
|
|
<a name="335"><span class="lineNum"> 335 </span> : : template<typename _Tp, typename _Seq></a>
|
|
<a name="336"><span class="lineNum"> 336 </span> : : inline bool</a>
|
|
<a name="337"><span class="lineNum"> 337 </span> : : operator!=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)</a>
|
|
<a name="338"><span class="lineNum"> 338 </span> : : { return !(__x == __y); }</a>
|
|
<a name="339"><span class="lineNum"> 339 </span> : : </a>
|
|
<a name="340"><span class="lineNum"> 340 </span> : : /// Based on operator<</a>
|
|
<a name="341"><span class="lineNum"> 341 </span> : : template<typename _Tp, typename _Seq></a>
|
|
<a name="342"><span class="lineNum"> 342 </span> : : inline bool</a>
|
|
<a name="343"><span class="lineNum"> 343 </span> : : operator>(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)</a>
|
|
<a name="344"><span class="lineNum"> 344 </span> : : { return __y < __x; }</a>
|
|
<a name="345"><span class="lineNum"> 345 </span> : : </a>
|
|
<a name="346"><span class="lineNum"> 346 </span> : : /// Based on operator<</a>
|
|
<a name="347"><span class="lineNum"> 347 </span> : : template<typename _Tp, typename _Seq></a>
|
|
<a name="348"><span class="lineNum"> 348 </span> : : inline bool</a>
|
|
<a name="349"><span class="lineNum"> 349 </span> : : operator<=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)</a>
|
|
<a name="350"><span class="lineNum"> 350 </span> : : { return !(__y < __x); }</a>
|
|
<a name="351"><span class="lineNum"> 351 </span> : : </a>
|
|
<a name="352"><span class="lineNum"> 352 </span> : : /// Based on operator<</a>
|
|
<a name="353"><span class="lineNum"> 353 </span> : : template<typename _Tp, typename _Seq></a>
|
|
<a name="354"><span class="lineNum"> 354 </span> : : inline bool</a>
|
|
<a name="355"><span class="lineNum"> 355 </span> : : operator>=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)</a>
|
|
<a name="356"><span class="lineNum"> 356 </span> : : { return !(__x < __y); }</a>
|
|
<a name="357"><span class="lineNum"> 357 </span> : : </a>
|
|
<a name="358"><span class="lineNum"> 358 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="359"><span class="lineNum"> 359 </span> : : template<typename _Tp, typename _Seq></a>
|
|
<a name="360"><span class="lineNum"> 360 </span> : : inline</a>
|
|
<a name="361"><span class="lineNum"> 361 </span> : : #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11</a>
|
|
<a name="362"><span class="lineNum"> 362 </span> : : // Constrained free swap overload, see p0185r1</a>
|
|
<a name="363"><span class="lineNum"> 363 </span> : : typename enable_if<__is_swappable<_Seq>::value>::type</a>
|
|
<a name="364"><span class="lineNum"> 364 </span> : : #else</a>
|
|
<a name="365"><span class="lineNum"> 365 </span> : : void</a>
|
|
<a name="366"><span class="lineNum"> 366 </span> : : #endif</a>
|
|
<a name="367"><span class="lineNum"> 367 </span> : : swap(stack<_Tp, _Seq>& __x, stack<_Tp, _Seq>& __y)</a>
|
|
<a name="368"><span class="lineNum"> 368 </span> : : noexcept(noexcept(__x.swap(__y)))</a>
|
|
<a name="369"><span class="lineNum"> 369 </span> : : { __x.swap(__y); }</a>
|
|
<a name="370"><span class="lineNum"> 370 </span> : : </a>
|
|
<a name="371"><span class="lineNum"> 371 </span> : : template<typename _Tp, typename _Seq, typename _Alloc></a>
|
|
<a name="372"><span class="lineNum"> 372 </span> : : struct uses_allocator<stack<_Tp, _Seq>, _Alloc></a>
|
|
<a name="373"><span class="lineNum"> 373 </span> : : : public uses_allocator<_Seq, _Alloc>::type { };</a>
|
|
<a name="374"><span class="lineNum"> 374 </span> : : #endif // __cplusplus >= 201103L</a>
|
|
<a name="375"><span class="lineNum"> 375 </span> : : </a>
|
|
<a name="376"><span class="lineNum"> 376 </span> : : _GLIBCXX_END_NAMESPACE_VERSION</a>
|
|
<a name="377"><span class="lineNum"> 377 </span> : : } // namespace</a>
|
|
<a name="378"><span class="lineNum"> 378 </span> : : </a>
|
|
<a name="379"><span class="lineNum"> 379 </span> : : #endif /* _STL_STACK_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>
|