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.
1548 lines
186 KiB
1548 lines
186 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_algobase.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_algobase.h<span style="font-size: 80%;"> (source / <a href="stl_algobase.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">0</td>
|
|
<td class="headerCovTableEntry">49</td>
|
|
<td class="headerCovTableEntryLo">0.0 %</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="headerItem">Date:</td>
|
|
<td class="headerValue">2022-06-07 00:07:53</td>
|
|
<td></td>
|
|
<td class="headerItem">Functions:</td>
|
|
<td class="headerCovTableEntry">0</td>
|
|
<td class="headerCovTableEntry">18</td>
|
|
<td class="headerCovTableEntryLo">0.0 %</td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td class="headerItem">Branches:</td>
|
|
<td class="headerCovTableEntry">0</td>
|
|
<td class="headerCovTableEntry">10</td>
|
|
<td class="headerCovTableEntryLo">0.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> : : // Core algorithmic facilities -*- 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-1998</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_algobase.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{algorithm}</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_ALGOBASE_H</a>
|
|
<a name="57"><span class="lineNum"> 57 </span> : : #define _STL_ALGOBASE_H 1</a>
|
|
<a name="58"><span class="lineNum"> 58 </span> : : </a>
|
|
<a name="59"><span class="lineNum"> 59 </span> : : #include <bits/c++config.h></a>
|
|
<a name="60"><span class="lineNum"> 60 </span> : : #include <bits/functexcept.h></a>
|
|
<a name="61"><span class="lineNum"> 61 </span> : : #include <bits/cpp_type_traits.h></a>
|
|
<a name="62"><span class="lineNum"> 62 </span> : : #include <ext/type_traits.h></a>
|
|
<a name="63"><span class="lineNum"> 63 </span> : : #include <ext/numeric_traits.h></a>
|
|
<a name="64"><span class="lineNum"> 64 </span> : : #include <bits/stl_pair.h></a>
|
|
<a name="65"><span class="lineNum"> 65 </span> : : #include <bits/stl_iterator_base_types.h></a>
|
|
<a name="66"><span class="lineNum"> 66 </span> : : #include <bits/stl_iterator_base_funcs.h></a>
|
|
<a name="67"><span class="lineNum"> 67 </span> : : #include <bits/stl_iterator.h></a>
|
|
<a name="68"><span class="lineNum"> 68 </span> : : #include <bits/concept_check.h></a>
|
|
<a name="69"><span class="lineNum"> 69 </span> : : #include <debug/debug.h></a>
|
|
<a name="70"><span class="lineNum"> 70 </span> : : #include <bits/move.h> // For std::swap</a>
|
|
<a name="71"><span class="lineNum"> 71 </span> : : #include <bits/predefined_ops.h></a>
|
|
<a name="72"><span class="lineNum"> 72 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="73"><span class="lineNum"> 73 </span> : : # include <type_traits></a>
|
|
<a name="74"><span class="lineNum"> 74 </span> : : #endif</a>
|
|
<a name="75"><span class="lineNum"> 75 </span> : : </a>
|
|
<a name="76"><span class="lineNum"> 76 </span> : : namespace std _GLIBCXX_VISIBILITY(default)</a>
|
|
<a name="77"><span class="lineNum"> 77 </span> : : {</a>
|
|
<a name="78"><span class="lineNum"> 78 </span> : : _GLIBCXX_BEGIN_NAMESPACE_VERSION</a>
|
|
<a name="79"><span class="lineNum"> 79 </span> : : </a>
|
|
<a name="80"><span class="lineNum"> 80 </span> : : #if __cplusplus < 201103L</a>
|
|
<a name="81"><span class="lineNum"> 81 </span> : : // See http://gcc.gnu.org/ml/libstdc++/2004-08/msg00167.html: in a</a>
|
|
<a name="82"><span class="lineNum"> 82 </span> : : // nutshell, we are partially implementing the resolution of DR 187,</a>
|
|
<a name="83"><span class="lineNum"> 83 </span> : : // when it's safe, i.e., the value_types are equal.</a>
|
|
<a name="84"><span class="lineNum"> 84 </span> : : template<bool _BoolType></a>
|
|
<a name="85"><span class="lineNum"> 85 </span> : : struct __iter_swap</a>
|
|
<a name="86"><span class="lineNum"> 86 </span> : : {</a>
|
|
<a name="87"><span class="lineNum"> 87 </span> : : template<typename _ForwardIterator1, typename _ForwardIterator2></a>
|
|
<a name="88"><span class="lineNum"> 88 </span> : : static void</a>
|
|
<a name="89"><span class="lineNum"> 89 </span> : : iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)</a>
|
|
<a name="90"><span class="lineNum"> 90 </span> : : {</a>
|
|
<a name="91"><span class="lineNum"> 91 </span> : : typedef typename iterator_traits<_ForwardIterator1>::value_type</a>
|
|
<a name="92"><span class="lineNum"> 92 </span> : : _ValueType1;</a>
|
|
<a name="93"><span class="lineNum"> 93 </span> : : _ValueType1 __tmp = *__a;</a>
|
|
<a name="94"><span class="lineNum"> 94 </span> : : *__a = *__b;</a>
|
|
<a name="95"><span class="lineNum"> 95 </span> : : *__b = __tmp;</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> : : template<></a>
|
|
<a name="100"><span class="lineNum"> 100 </span> : : struct __iter_swap<true></a>
|
|
<a name="101"><span class="lineNum"> 101 </span> : : {</a>
|
|
<a name="102"><span class="lineNum"> 102 </span> : : template<typename _ForwardIterator1, typename _ForwardIterator2></a>
|
|
<a name="103"><span class="lineNum"> 103 </span> : : static void</a>
|
|
<a name="104"><span class="lineNum"> 104 </span> : : iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)</a>
|
|
<a name="105"><span class="lineNum"> 105 </span> : : {</a>
|
|
<a name="106"><span class="lineNum"> 106 </span> : : swap(*__a, *__b);</a>
|
|
<a name="107"><span class="lineNum"> 107 </span> : : }</a>
|
|
<a name="108"><span class="lineNum"> 108 </span> : : };</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> : : /**</a>
|
|
<a name="112"><span class="lineNum"> 112 </span> : : * @brief Swaps the contents of two iterators.</a>
|
|
<a name="113"><span class="lineNum"> 113 </span> : : * @ingroup mutating_algorithms</a>
|
|
<a name="114"><span class="lineNum"> 114 </span> : : * @param __a An iterator.</a>
|
|
<a name="115"><span class="lineNum"> 115 </span> : : * @param __b Another iterator.</a>
|
|
<a name="116"><span class="lineNum"> 116 </span> : : * @return Nothing.</a>
|
|
<a name="117"><span class="lineNum"> 117 </span> : : *</a>
|
|
<a name="118"><span class="lineNum"> 118 </span> : : * This function swaps the values pointed to by two iterators, not the</a>
|
|
<a name="119"><span class="lineNum"> 119 </span> : : * iterators themselves.</a>
|
|
<a name="120"><span class="lineNum"> 120 </span> : : */</a>
|
|
<a name="121"><span class="lineNum"> 121 </span> : : template<typename _ForwardIterator1, typename _ForwardIterator2></a>
|
|
<a name="122"><span class="lineNum"> 122 </span> : : inline void</a>
|
|
<a name="123"><span class="lineNum"> 123 </span> : : iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)</a>
|
|
<a name="124"><span class="lineNum"> 124 </span> : : {</a>
|
|
<a name="125"><span class="lineNum"> 125 </span> : : // concept requirements</a>
|
|
<a name="126"><span class="lineNum"> 126 </span> : : __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<</a>
|
|
<a name="127"><span class="lineNum"> 127 </span> : : _ForwardIterator1>)</a>
|
|
<a name="128"><span class="lineNum"> 128 </span> : : __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<</a>
|
|
<a name="129"><span class="lineNum"> 129 </span> : : _ForwardIterator2>)</a>
|
|
<a name="130"><span class="lineNum"> 130 </span> : : </a>
|
|
<a name="131"><span class="lineNum"> 131 </span> : : #if __cplusplus < 201103L</a>
|
|
<a name="132"><span class="lineNum"> 132 </span> : : typedef typename iterator_traits<_ForwardIterator1>::value_type</a>
|
|
<a name="133"><span class="lineNum"> 133 </span> : : _ValueType1;</a>
|
|
<a name="134"><span class="lineNum"> 134 </span> : : typedef typename iterator_traits<_ForwardIterator2>::value_type</a>
|
|
<a name="135"><span class="lineNum"> 135 </span> : : _ValueType2;</a>
|
|
<a name="136"><span class="lineNum"> 136 </span> : : </a>
|
|
<a name="137"><span class="lineNum"> 137 </span> : : __glibcxx_function_requires(_ConvertibleConcept<_ValueType1,</a>
|
|
<a name="138"><span class="lineNum"> 138 </span> : : _ValueType2>)</a>
|
|
<a name="139"><span class="lineNum"> 139 </span> : : __glibcxx_function_requires(_ConvertibleConcept<_ValueType2,</a>
|
|
<a name="140"><span class="lineNum"> 140 </span> : : _ValueType1>)</a>
|
|
<a name="141"><span class="lineNum"> 141 </span> : : </a>
|
|
<a name="142"><span class="lineNum"> 142 </span> : : typedef typename iterator_traits<_ForwardIterator1>::reference</a>
|
|
<a name="143"><span class="lineNum"> 143 </span> : : _ReferenceType1;</a>
|
|
<a name="144"><span class="lineNum"> 144 </span> : : typedef typename iterator_traits<_ForwardIterator2>::reference</a>
|
|
<a name="145"><span class="lineNum"> 145 </span> : : _ReferenceType2;</a>
|
|
<a name="146"><span class="lineNum"> 146 </span> : : std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value</a>
|
|
<a name="147"><span class="lineNum"> 147 </span> : : && __are_same<_ValueType1&, _ReferenceType1>::__value</a>
|
|
<a name="148"><span class="lineNum"> 148 </span> : : && __are_same<_ValueType2&, _ReferenceType2>::__value>::</a>
|
|
<a name="149"><span class="lineNum"> 149 </span> : : iter_swap(__a, __b);</a>
|
|
<a name="150"><span class="lineNum"> 150 </span> : : #else</a>
|
|
<a name="151"><span class="lineNum"> 151 </span> : : swap(*__a, *__b);</a>
|
|
<a name="152"><span class="lineNum"> 152 </span> : : #endif</a>
|
|
<a name="153"><span class="lineNum"> 153 </span> : : }</a>
|
|
<a name="154"><span class="lineNum"> 154 </span> : : </a>
|
|
<a name="155"><span class="lineNum"> 155 </span> : : /**</a>
|
|
<a name="156"><span class="lineNum"> 156 </span> : : * @brief Swap the elements of two sequences.</a>
|
|
<a name="157"><span class="lineNum"> 157 </span> : : * @ingroup mutating_algorithms</a>
|
|
<a name="158"><span class="lineNum"> 158 </span> : : * @param __first1 A forward iterator.</a>
|
|
<a name="159"><span class="lineNum"> 159 </span> : : * @param __last1 A forward iterator.</a>
|
|
<a name="160"><span class="lineNum"> 160 </span> : : * @param __first2 A forward iterator.</a>
|
|
<a name="161"><span class="lineNum"> 161 </span> : : * @return An iterator equal to @p first2+(last1-first1).</a>
|
|
<a name="162"><span class="lineNum"> 162 </span> : : *</a>
|
|
<a name="163"><span class="lineNum"> 163 </span> : : * Swaps each element in the range @p [first1,last1) with the</a>
|
|
<a name="164"><span class="lineNum"> 164 </span> : : * corresponding element in the range @p [first2,(last1-first1)).</a>
|
|
<a name="165"><span class="lineNum"> 165 </span> : : * The ranges must not overlap.</a>
|
|
<a name="166"><span class="lineNum"> 166 </span> : : */</a>
|
|
<a name="167"><span class="lineNum"> 167 </span> : : template<typename _ForwardIterator1, typename _ForwardIterator2></a>
|
|
<a name="168"><span class="lineNum"> 168 </span> : : _ForwardIterator2</a>
|
|
<a name="169"><span class="lineNum"> 169 </span> : : swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,</a>
|
|
<a name="170"><span class="lineNum"> 170 </span> : : _ForwardIterator2 __first2)</a>
|
|
<a name="171"><span class="lineNum"> 171 </span> : : {</a>
|
|
<a name="172"><span class="lineNum"> 172 </span> : : // concept requirements</a>
|
|
<a name="173"><span class="lineNum"> 173 </span> : : __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<</a>
|
|
<a name="174"><span class="lineNum"> 174 </span> : : _ForwardIterator1>)</a>
|
|
<a name="175"><span class="lineNum"> 175 </span> : : __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<</a>
|
|
<a name="176"><span class="lineNum"> 176 </span> : : _ForwardIterator2>)</a>
|
|
<a name="177"><span class="lineNum"> 177 </span> : : __glibcxx_requires_valid_range(__first1, __last1);</a>
|
|
<a name="178"><span class="lineNum"> 178 </span> : : </a>
|
|
<a name="179"><span class="lineNum"> 179 </span> : : for (; __first1 != __last1; ++__first1, (void)++__first2)</a>
|
|
<a name="180"><span class="lineNum"> 180 </span> : : std::iter_swap(__first1, __first2);</a>
|
|
<a name="181"><span class="lineNum"> 181 </span> : : return __first2;</a>
|
|
<a name="182"><span class="lineNum"> 182 </span> : : }</a>
|
|
<a name="183"><span class="lineNum"> 183 </span> : : </a>
|
|
<a name="184"><span class="lineNum"> 184 </span> : : /**</a>
|
|
<a name="185"><span class="lineNum"> 185 </span> : : * @brief This does what you think it does.</a>
|
|
<a name="186"><span class="lineNum"> 186 </span> : : * @ingroup sorting_algorithms</a>
|
|
<a name="187"><span class="lineNum"> 187 </span> : : * @param __a A thing of arbitrary type.</a>
|
|
<a name="188"><span class="lineNum"> 188 </span> : : * @param __b Another thing of arbitrary type.</a>
|
|
<a name="189"><span class="lineNum"> 189 </span> : : * @return The lesser of the parameters.</a>
|
|
<a name="190"><span class="lineNum"> 190 </span> : : *</a>
|
|
<a name="191"><span class="lineNum"> 191 </span> : : * This is the simple classic generic implementation. It will work on</a>
|
|
<a name="192"><span class="lineNum"> 192 </span> : : * temporary expressions, since they are only evaluated once, unlike a</a>
|
|
<a name="193"><span class="lineNum"> 193 </span> : : * preprocessor macro.</a>
|
|
<a name="194"><span class="lineNum"> 194 </span> : : */</a>
|
|
<a name="195"><span class="lineNum"> 195 </span> : : template<typename _Tp></a>
|
|
<a name="196"><span class="lineNum"> 196 </span> : : _GLIBCXX14_CONSTEXPR</a>
|
|
<a name="197"><span class="lineNum"> 197 </span> : : inline const _Tp&</a>
|
|
<a name="198"><span class="lineNum"> 198 </span> :<span class="lineNoCov"> 0 : min(const _Tp& __a, const _Tp& __b)</span></a>
|
|
<a name="199"><span class="lineNum"> 199 </span> : : {</a>
|
|
<a name="200"><span class="lineNum"> 200 </span> : : // concept requirements</a>
|
|
<a name="201"><span class="lineNum"> 201 </span> : : __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)</a>
|
|
<a name="202"><span class="lineNum"> 202 </span> : : //return __b < __a ? __b : __a;</a>
|
|
<a name="203"><span class="lineNum"> 203 </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 : if (__b < __a)</span></a>
|
|
<a name="204"><span class="lineNum"> 204 </span> :<span class="lineNoCov"> 0 : return __b;</span></a>
|
|
<a name="205"><span class="lineNum"> 205 </span> :<span class="lineNoCov"> 0 : return __a;</span></a>
|
|
<a name="206"><span class="lineNum"> 206 </span> : : }</a>
|
|
<a name="207"><span class="lineNum"> 207 </span> : : </a>
|
|
<a name="208"><span class="lineNum"> 208 </span> : : /**</a>
|
|
<a name="209"><span class="lineNum"> 209 </span> : : * @brief This does what you think it does.</a>
|
|
<a name="210"><span class="lineNum"> 210 </span> : : * @ingroup sorting_algorithms</a>
|
|
<a name="211"><span class="lineNum"> 211 </span> : : * @param __a A thing of arbitrary type.</a>
|
|
<a name="212"><span class="lineNum"> 212 </span> : : * @param __b Another thing of arbitrary type.</a>
|
|
<a name="213"><span class="lineNum"> 213 </span> : : * @return The greater of the parameters.</a>
|
|
<a name="214"><span class="lineNum"> 214 </span> : : *</a>
|
|
<a name="215"><span class="lineNum"> 215 </span> : : * This is the simple classic generic implementation. It will work on</a>
|
|
<a name="216"><span class="lineNum"> 216 </span> : : * temporary expressions, since they are only evaluated once, unlike a</a>
|
|
<a name="217"><span class="lineNum"> 217 </span> : : * preprocessor macro.</a>
|
|
<a name="218"><span class="lineNum"> 218 </span> : : */</a>
|
|
<a name="219"><span class="lineNum"> 219 </span> : : template<typename _Tp></a>
|
|
<a name="220"><span class="lineNum"> 220 </span> : : _GLIBCXX14_CONSTEXPR</a>
|
|
<a name="221"><span class="lineNum"> 221 </span> : : inline const _Tp&</a>
|
|
<a name="222"><span class="lineNum"> 222 </span> :<span class="lineNoCov"> 0 : max(const _Tp& __a, const _Tp& __b)</span></a>
|
|
<a name="223"><span class="lineNum"> 223 </span> : : {</a>
|
|
<a name="224"><span class="lineNum"> 224 </span> : : // concept requirements</a>
|
|
<a name="225"><span class="lineNum"> 225 </span> : : __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)</a>
|
|
<a name="226"><span class="lineNum"> 226 </span> : : //return __a < __b ? __b : __a;</a>
|
|
<a name="227"><span class="lineNum"> 227 </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 : if (__a < __b)</span></a>
|
|
<a name="228"><span class="lineNum"> 228 </span> :<span class="lineNoCov"> 0 : return __b;</span></a>
|
|
<a name="229"><span class="lineNum"> 229 </span> :<span class="lineNoCov"> 0 : return __a;</span></a>
|
|
<a name="230"><span class="lineNum"> 230 </span> : : }</a>
|
|
<a name="231"><span class="lineNum"> 231 </span> : : </a>
|
|
<a name="232"><span class="lineNum"> 232 </span> : : /**</a>
|
|
<a name="233"><span class="lineNum"> 233 </span> : : * @brief This does what you think it does.</a>
|
|
<a name="234"><span class="lineNum"> 234 </span> : : * @ingroup sorting_algorithms</a>
|
|
<a name="235"><span class="lineNum"> 235 </span> : : * @param __a A thing of arbitrary type.</a>
|
|
<a name="236"><span class="lineNum"> 236 </span> : : * @param __b Another thing of arbitrary type.</a>
|
|
<a name="237"><span class="lineNum"> 237 </span> : : * @param __comp A @link comparison_functors comparison functor@endlink.</a>
|
|
<a name="238"><span class="lineNum"> 238 </span> : : * @return The lesser of the parameters.</a>
|
|
<a name="239"><span class="lineNum"> 239 </span> : : *</a>
|
|
<a name="240"><span class="lineNum"> 240 </span> : : * This will work on temporary expressions, since they are only evaluated</a>
|
|
<a name="241"><span class="lineNum"> 241 </span> : : * once, unlike a preprocessor macro.</a>
|
|
<a name="242"><span class="lineNum"> 242 </span> : : */</a>
|
|
<a name="243"><span class="lineNum"> 243 </span> : : template<typename _Tp, typename _Compare></a>
|
|
<a name="244"><span class="lineNum"> 244 </span> : : _GLIBCXX14_CONSTEXPR</a>
|
|
<a name="245"><span class="lineNum"> 245 </span> : : inline const _Tp&</a>
|
|
<a name="246"><span class="lineNum"> 246 </span> : : min(const _Tp& __a, const _Tp& __b, _Compare __comp)</a>
|
|
<a name="247"><span class="lineNum"> 247 </span> : : {</a>
|
|
<a name="248"><span class="lineNum"> 248 </span> : : //return __comp(__b, __a) ? __b : __a;</a>
|
|
<a name="249"><span class="lineNum"> 249 </span> : : if (__comp(__b, __a))</a>
|
|
<a name="250"><span class="lineNum"> 250 </span> : : return __b;</a>
|
|
<a name="251"><span class="lineNum"> 251 </span> : : return __a;</a>
|
|
<a name="252"><span class="lineNum"> 252 </span> : : }</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 This does what you think it does.</a>
|
|
<a name="256"><span class="lineNum"> 256 </span> : : * @ingroup sorting_algorithms</a>
|
|
<a name="257"><span class="lineNum"> 257 </span> : : * @param __a A thing of arbitrary type.</a>
|
|
<a name="258"><span class="lineNum"> 258 </span> : : * @param __b Another thing of arbitrary type.</a>
|
|
<a name="259"><span class="lineNum"> 259 </span> : : * @param __comp A @link comparison_functors comparison functor@endlink.</a>
|
|
<a name="260"><span class="lineNum"> 260 </span> : : * @return The greater of the parameters.</a>
|
|
<a name="261"><span class="lineNum"> 261 </span> : : *</a>
|
|
<a name="262"><span class="lineNum"> 262 </span> : : * This will work on temporary expressions, since they are only evaluated</a>
|
|
<a name="263"><span class="lineNum"> 263 </span> : : * once, unlike a preprocessor macro.</a>
|
|
<a name="264"><span class="lineNum"> 264 </span> : : */</a>
|
|
<a name="265"><span class="lineNum"> 265 </span> : : template<typename _Tp, typename _Compare></a>
|
|
<a name="266"><span class="lineNum"> 266 </span> : : _GLIBCXX14_CONSTEXPR</a>
|
|
<a name="267"><span class="lineNum"> 267 </span> : : inline const _Tp&</a>
|
|
<a name="268"><span class="lineNum"> 268 </span> : : max(const _Tp& __a, const _Tp& __b, _Compare __comp)</a>
|
|
<a name="269"><span class="lineNum"> 269 </span> : : {</a>
|
|
<a name="270"><span class="lineNum"> 270 </span> : : //return __comp(__a, __b) ? __b : __a;</a>
|
|
<a name="271"><span class="lineNum"> 271 </span> : : if (__comp(__a, __b))</a>
|
|
<a name="272"><span class="lineNum"> 272 </span> : : return __b;</a>
|
|
<a name="273"><span class="lineNum"> 273 </span> : : return __a;</a>
|
|
<a name="274"><span class="lineNum"> 274 </span> : : }</a>
|
|
<a name="275"><span class="lineNum"> 275 </span> : : </a>
|
|
<a name="276"><span class="lineNum"> 276 </span> : : // Fallback implementation of the function in bits/stl_iterator.h used to</a>
|
|
<a name="277"><span class="lineNum"> 277 </span> : : // remove the __normal_iterator wrapper. See copy, fill, ...</a>
|
|
<a name="278"><span class="lineNum"> 278 </span> : : template<typename _Iterator></a>
|
|
<a name="279"><span class="lineNum"> 279 </span> : : inline _Iterator</a>
|
|
<a name="280"><span class="lineNum"> 280 </span> :<span class="lineNoCov"> 0 : __niter_base(_Iterator __it)</span></a>
|
|
<a name="281"><span class="lineNum"> 281 </span> : : _GLIBCXX_NOEXCEPT_IF(std::is_nothrow_copy_constructible<_Iterator>::value)</a>
|
|
<a name="282"><span class="lineNum"> 282 </span> :<span class="lineNoCov"> 0 : { return __it; }</span></a>
|
|
<a name="283"><span class="lineNum"> 283 </span> : : </a>
|
|
<a name="284"><span class="lineNum"> 284 </span> : : // Reverse the __niter_base transformation to get a</a>
|
|
<a name="285"><span class="lineNum"> 285 </span> : : // __normal_iterator back again (this assumes that __normal_iterator</a>
|
|
<a name="286"><span class="lineNum"> 286 </span> : : // is only used to wrap random access iterators, like pointers).</a>
|
|
<a name="287"><span class="lineNum"> 287 </span> : : template<typename _From, typename _To></a>
|
|
<a name="288"><span class="lineNum"> 288 </span> : : inline _From</a>
|
|
<a name="289"><span class="lineNum"> 289 </span> : : __niter_wrap(_From __from, _To __res)</a>
|
|
<a name="290"><span class="lineNum"> 290 </span> : : { return __from + (__res - std::__niter_base(__from)); }</a>
|
|
<a name="291"><span class="lineNum"> 291 </span> : : </a>
|
|
<a name="292"><span class="lineNum"> 292 </span> : : // No need to wrap, iterator already has the right type.</a>
|
|
<a name="293"><span class="lineNum"> 293 </span> : : template<typename _Iterator></a>
|
|
<a name="294"><span class="lineNum"> 294 </span> : : inline _Iterator</a>
|
|
<a name="295"><span class="lineNum"> 295 </span> :<span class="lineNoCov"> 0 : __niter_wrap(const _Iterator&, _Iterator __res)</span></a>
|
|
<a name="296"><span class="lineNum"> 296 </span> :<span class="lineNoCov"> 0 : { return __res; }</span></a>
|
|
<a name="297"><span class="lineNum"> 297 </span> : : </a>
|
|
<a name="298"><span class="lineNum"> 298 </span> : : // All of these auxiliary structs serve two purposes. (1) Replace</a>
|
|
<a name="299"><span class="lineNum"> 299 </span> : : // calls to copy with memmove whenever possible. (Memmove, not memcpy,</a>
|
|
<a name="300"><span class="lineNum"> 300 </span> : : // because the input and output ranges are permitted to overlap.)</a>
|
|
<a name="301"><span class="lineNum"> 301 </span> : : // (2) If we're using random access iterators, then write the loop as</a>
|
|
<a name="302"><span class="lineNum"> 302 </span> : : // a for loop with an explicit count.</a>
|
|
<a name="303"><span class="lineNum"> 303 </span> : : </a>
|
|
<a name="304"><span class="lineNum"> 304 </span> : : template<bool _IsMove, bool _IsSimple, typename _Category></a>
|
|
<a name="305"><span class="lineNum"> 305 </span> : : struct __copy_move</a>
|
|
<a name="306"><span class="lineNum"> 306 </span> : : {</a>
|
|
<a name="307"><span class="lineNum"> 307 </span> : : template<typename _II, typename _OI></a>
|
|
<a name="308"><span class="lineNum"> 308 </span> : : static _OI</a>
|
|
<a name="309"><span class="lineNum"> 309 </span> : : __copy_m(_II __first, _II __last, _OI __result)</a>
|
|
<a name="310"><span class="lineNum"> 310 </span> : : {</a>
|
|
<a name="311"><span class="lineNum"> 311 </span> : : for (; __first != __last; ++__result, (void)++__first)</a>
|
|
<a name="312"><span class="lineNum"> 312 </span> : : *__result = *__first;</a>
|
|
<a name="313"><span class="lineNum"> 313 </span> : : return __result;</a>
|
|
<a name="314"><span class="lineNum"> 314 </span> : : }</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> : : #if __cplusplus >= 201103L</a>
|
|
<a name="318"><span class="lineNum"> 318 </span> : : template<typename _Category></a>
|
|
<a name="319"><span class="lineNum"> 319 </span> : : struct __copy_move<true, false, _Category></a>
|
|
<a name="320"><span class="lineNum"> 320 </span> : : {</a>
|
|
<a name="321"><span class="lineNum"> 321 </span> : : template<typename _II, typename _OI></a>
|
|
<a name="322"><span class="lineNum"> 322 </span> : : static _OI</a>
|
|
<a name="323"><span class="lineNum"> 323 </span> : : __copy_m(_II __first, _II __last, _OI __result)</a>
|
|
<a name="324"><span class="lineNum"> 324 </span> : : {</a>
|
|
<a name="325"><span class="lineNum"> 325 </span> : : for (; __first != __last; ++__result, (void)++__first)</a>
|
|
<a name="326"><span class="lineNum"> 326 </span> : : *__result = std::move(*__first);</a>
|
|
<a name="327"><span class="lineNum"> 327 </span> : : return __result;</a>
|
|
<a name="328"><span class="lineNum"> 328 </span> : : }</a>
|
|
<a name="329"><span class="lineNum"> 329 </span> : : };</a>
|
|
<a name="330"><span class="lineNum"> 330 </span> : : #endif</a>
|
|
<a name="331"><span class="lineNum"> 331 </span> : : </a>
|
|
<a name="332"><span class="lineNum"> 332 </span> : : template<></a>
|
|
<a name="333"><span class="lineNum"> 333 </span> : : struct __copy_move<false, false, random_access_iterator_tag></a>
|
|
<a name="334"><span class="lineNum"> 334 </span> : : {</a>
|
|
<a name="335"><span class="lineNum"> 335 </span> : : template<typename _II, typename _OI></a>
|
|
<a name="336"><span class="lineNum"> 336 </span> : : static _OI</a>
|
|
<a name="337"><span class="lineNum"> 337 </span> : : __copy_m(_II __first, _II __last, _OI __result)</a>
|
|
<a name="338"><span class="lineNum"> 338 </span> : : {</a>
|
|
<a name="339"><span class="lineNum"> 339 </span> : : typedef typename iterator_traits<_II>::difference_type _Distance;</a>
|
|
<a name="340"><span class="lineNum"> 340 </span> : : for(_Distance __n = __last - __first; __n > 0; --__n)</a>
|
|
<a name="341"><span class="lineNum"> 341 </span> : : {</a>
|
|
<a name="342"><span class="lineNum"> 342 </span> : : *__result = *__first;</a>
|
|
<a name="343"><span class="lineNum"> 343 </span> : : ++__first;</a>
|
|
<a name="344"><span class="lineNum"> 344 </span> : : ++__result;</a>
|
|
<a name="345"><span class="lineNum"> 345 </span> : : }</a>
|
|
<a name="346"><span class="lineNum"> 346 </span> : : return __result;</a>
|
|
<a name="347"><span class="lineNum"> 347 </span> : : }</a>
|
|
<a name="348"><span class="lineNum"> 348 </span> : : };</a>
|
|
<a name="349"><span class="lineNum"> 349 </span> : : </a>
|
|
<a name="350"><span class="lineNum"> 350 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="351"><span class="lineNum"> 351 </span> : : template<></a>
|
|
<a name="352"><span class="lineNum"> 352 </span> : : struct __copy_move<true, false, random_access_iterator_tag></a>
|
|
<a name="353"><span class="lineNum"> 353 </span> : : {</a>
|
|
<a name="354"><span class="lineNum"> 354 </span> : : template<typename _II, typename _OI></a>
|
|
<a name="355"><span class="lineNum"> 355 </span> : : static _OI</a>
|
|
<a name="356"><span class="lineNum"> 356 </span> : : __copy_m(_II __first, _II __last, _OI __result)</a>
|
|
<a name="357"><span class="lineNum"> 357 </span> : : {</a>
|
|
<a name="358"><span class="lineNum"> 358 </span> : : typedef typename iterator_traits<_II>::difference_type _Distance;</a>
|
|
<a name="359"><span class="lineNum"> 359 </span> : : for(_Distance __n = __last - __first; __n > 0; --__n)</a>
|
|
<a name="360"><span class="lineNum"> 360 </span> : : {</a>
|
|
<a name="361"><span class="lineNum"> 361 </span> : : *__result = std::move(*__first);</a>
|
|
<a name="362"><span class="lineNum"> 362 </span> : : ++__first;</a>
|
|
<a name="363"><span class="lineNum"> 363 </span> : : ++__result;</a>
|
|
<a name="364"><span class="lineNum"> 364 </span> : : }</a>
|
|
<a name="365"><span class="lineNum"> 365 </span> : : return __result;</a>
|
|
<a name="366"><span class="lineNum"> 366 </span> : : }</a>
|
|
<a name="367"><span class="lineNum"> 367 </span> : : };</a>
|
|
<a name="368"><span class="lineNum"> 368 </span> : : #endif</a>
|
|
<a name="369"><span class="lineNum"> 369 </span> : : </a>
|
|
<a name="370"><span class="lineNum"> 370 </span> : : template<bool _IsMove></a>
|
|
<a name="371"><span class="lineNum"> 371 </span> : : struct __copy_move<_IsMove, true, random_access_iterator_tag></a>
|
|
<a name="372"><span class="lineNum"> 372 </span> : : {</a>
|
|
<a name="373"><span class="lineNum"> 373 </span> : : template<typename _Tp></a>
|
|
<a name="374"><span class="lineNum"> 374 </span> : : static _Tp*</a>
|
|
<a name="375"><span class="lineNum"> 375 </span> :<span class="lineNoCov"> 0 : __copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result)</span></a>
|
|
<a name="376"><span class="lineNum"> 376 </span> : : {</a>
|
|
<a name="377"><span class="lineNum"> 377 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="378"><span class="lineNum"> 378 </span> : : using __assignable = conditional<_IsMove,</a>
|
|
<a name="379"><span class="lineNum"> 379 </span> : : is_move_assignable<_Tp>,</a>
|
|
<a name="380"><span class="lineNum"> 380 </span> : : is_copy_assignable<_Tp>>;</a>
|
|
<a name="381"><span class="lineNum"> 381 </span> : : // trivial types can have deleted assignment</a>
|
|
<a name="382"><span class="lineNum"> 382 </span> : : static_assert( __assignable::type::value, "type is not assignable" );</a>
|
|
<a name="383"><span class="lineNum"> 383 </span> : : #endif</a>
|
|
<a name="384"><span class="lineNum"> 384 </span> :<span class="lineNoCov"> 0 : const ptrdiff_t _Num = __last - __first;</span></a>
|
|
<a name="385"><span class="lineNum"> 385 </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 : if (_Num)</span></a>
|
|
<a name="386"><span class="lineNum"> 386 </span> :<span class="lineNoCov"> 0 : __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);</span></a>
|
|
<a name="387"><span class="lineNum"> 387 </span> :<span class="lineNoCov"> 0 : return __result + _Num;</span></a>
|
|
<a name="388"><span class="lineNum"> 388 </span> : : }</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<bool _IsMove, typename _II, typename _OI></a>
|
|
<a name="392"><span class="lineNum"> 392 </span> : : inline _OI</a>
|
|
<a name="393"><span class="lineNum"> 393 </span> :<span class="lineNoCov"> 0 : __copy_move_a(_II __first, _II __last, _OI __result)</span></a>
|
|
<a name="394"><span class="lineNum"> 394 </span> : : {</a>
|
|
<a name="395"><span class="lineNum"> 395 </span> : : typedef typename iterator_traits<_II>::value_type _ValueTypeI;</a>
|
|
<a name="396"><span class="lineNum"> 396 </span> : : typedef typename iterator_traits<_OI>::value_type _ValueTypeO;</a>
|
|
<a name="397"><span class="lineNum"> 397 </span> : : typedef typename iterator_traits<_II>::iterator_category _Category;</a>
|
|
<a name="398"><span class="lineNum"> 398 </span> :<span class="lineNoCov"> 0 : const bool __simple = (__is_trivially_copyable(_ValueTypeI)</span></a>
|
|
<a name="399"><span class="lineNum"> 399 </span> : : && __is_pointer<_II>::__value</a>
|
|
<a name="400"><span class="lineNum"> 400 </span> : : && __is_pointer<_OI>::__value</a>
|
|
<a name="401"><span class="lineNum"> 401 </span> : : && __are_same<_ValueTypeI, _ValueTypeO>::__value);</a>
|
|
<a name="402"><span class="lineNum"> 402 </span> : : </a>
|
|
<a name="403"><span class="lineNum"> 403 </span> : : return std::__copy_move<_IsMove, __simple,</a>
|
|
<a name="404"><span class="lineNum"> 404 </span> :<span class="lineNoCov"> 0 : _Category>::__copy_m(__first, __last, __result);</span></a>
|
|
<a name="405"><span class="lineNum"> 405 </span> : : }</a>
|
|
<a name="406"><span class="lineNum"> 406 </span> : : </a>
|
|
<a name="407"><span class="lineNum"> 407 </span> : : // Helpers for streambuf iterators (either istream or ostream).</a>
|
|
<a name="408"><span class="lineNum"> 408 </span> : : // NB: avoid including <iosfwd>, relatively large.</a>
|
|
<a name="409"><span class="lineNum"> 409 </span> : : template<typename _CharT></a>
|
|
<a name="410"><span class="lineNum"> 410 </span> : : struct char_traits;</a>
|
|
<a name="411"><span class="lineNum"> 411 </span> : : </a>
|
|
<a name="412"><span class="lineNum"> 412 </span> : : template<typename _CharT, typename _Traits></a>
|
|
<a name="413"><span class="lineNum"> 413 </span> : : class istreambuf_iterator;</a>
|
|
<a name="414"><span class="lineNum"> 414 </span> : : </a>
|
|
<a name="415"><span class="lineNum"> 415 </span> : : template<typename _CharT, typename _Traits></a>
|
|
<a name="416"><span class="lineNum"> 416 </span> : : class ostreambuf_iterator;</a>
|
|
<a name="417"><span class="lineNum"> 417 </span> : : </a>
|
|
<a name="418"><span class="lineNum"> 418 </span> : : template<bool _IsMove, typename _CharT></a>
|
|
<a name="419"><span class="lineNum"> 419 </span> : : typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,</a>
|
|
<a name="420"><span class="lineNum"> 420 </span> : : ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type</a>
|
|
<a name="421"><span class="lineNum"> 421 </span> : : __copy_move_a2(_CharT*, _CharT*,</a>
|
|
<a name="422"><span class="lineNum"> 422 </span> : : ostreambuf_iterator<_CharT, char_traits<_CharT> >);</a>
|
|
<a name="423"><span class="lineNum"> 423 </span> : : </a>
|
|
<a name="424"><span class="lineNum"> 424 </span> : : template<bool _IsMove, typename _CharT></a>
|
|
<a name="425"><span class="lineNum"> 425 </span> : : typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,</a>
|
|
<a name="426"><span class="lineNum"> 426 </span> : : ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type</a>
|
|
<a name="427"><span class="lineNum"> 427 </span> : : __copy_move_a2(const _CharT*, const _CharT*,</a>
|
|
<a name="428"><span class="lineNum"> 428 </span> : : ostreambuf_iterator<_CharT, char_traits<_CharT> >);</a>
|
|
<a name="429"><span class="lineNum"> 429 </span> : : </a>
|
|
<a name="430"><span class="lineNum"> 430 </span> : : template<bool _IsMove, typename _CharT></a>
|
|
<a name="431"><span class="lineNum"> 431 </span> : : typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,</a>
|
|
<a name="432"><span class="lineNum"> 432 </span> : : _CharT*>::__type</a>
|
|
<a name="433"><span class="lineNum"> 433 </span> : : __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >,</a>
|
|
<a name="434"><span class="lineNum"> 434 </span> : : istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*);</a>
|
|
<a name="435"><span class="lineNum"> 435 </span> : : </a>
|
|
<a name="436"><span class="lineNum"> 436 </span> : : template<bool _IsMove, typename _II, typename _OI></a>
|
|
<a name="437"><span class="lineNum"> 437 </span> : : inline _OI</a>
|
|
<a name="438"><span class="lineNum"> 438 </span> :<span class="lineNoCov"> 0 : __copy_move_a2(_II __first, _II __last, _OI __result)</span></a>
|
|
<a name="439"><span class="lineNum"> 439 </span> : : {</a>
|
|
<a name="440"><span class="lineNum"> 440 </span> :<span class="lineNoCov"> 0 : return std::__niter_wrap(__result,</span></a>
|
|
<a name="441"><span class="lineNum"> 441 </span> : : std::__copy_move_a<_IsMove>(std::__niter_base(__first),</a>
|
|
<a name="442"><span class="lineNum"> 442 </span> : : std::__niter_base(__last),</a>
|
|
<a name="443"><span class="lineNum"> 443 </span> :<span class="lineNoCov"> 0 : std::__niter_base(__result)));</span></a>
|
|
<a name="444"><span class="lineNum"> 444 </span> : : }</a>
|
|
<a name="445"><span class="lineNum"> 445 </span> : : </a>
|
|
<a name="446"><span class="lineNum"> 446 </span> : : /**</a>
|
|
<a name="447"><span class="lineNum"> 447 </span> : : * @brief Copies the range [first,last) into result.</a>
|
|
<a name="448"><span class="lineNum"> 448 </span> : : * @ingroup mutating_algorithms</a>
|
|
<a name="449"><span class="lineNum"> 449 </span> : : * @param __first An input iterator.</a>
|
|
<a name="450"><span class="lineNum"> 450 </span> : : * @param __last An input iterator.</a>
|
|
<a name="451"><span class="lineNum"> 451 </span> : : * @param __result An output iterator.</a>
|
|
<a name="452"><span class="lineNum"> 452 </span> : : * @return result + (last - first)</a>
|
|
<a name="453"><span class="lineNum"> 453 </span> : : *</a>
|
|
<a name="454"><span class="lineNum"> 454 </span> : : * This inline function will boil down to a call to @c memmove whenever</a>
|
|
<a name="455"><span class="lineNum"> 455 </span> : : * possible. Failing that, if random access iterators are passed, then the</a>
|
|
<a name="456"><span class="lineNum"> 456 </span> : : * loop count will be known (and therefore a candidate for compiler</a>
|
|
<a name="457"><span class="lineNum"> 457 </span> : : * optimizations such as unrolling). Result may not be contained within</a>
|
|
<a name="458"><span class="lineNum"> 458 </span> : : * [first,last); the copy_backward function should be used instead.</a>
|
|
<a name="459"><span class="lineNum"> 459 </span> : : *</a>
|
|
<a name="460"><span class="lineNum"> 460 </span> : : * Note that the end of the output range is permitted to be contained</a>
|
|
<a name="461"><span class="lineNum"> 461 </span> : : * within [first,last).</a>
|
|
<a name="462"><span class="lineNum"> 462 </span> : : */</a>
|
|
<a name="463"><span class="lineNum"> 463 </span> : : template<typename _II, typename _OI></a>
|
|
<a name="464"><span class="lineNum"> 464 </span> : : inline _OI</a>
|
|
<a name="465"><span class="lineNum"> 465 </span> :<span class="lineNoCov"> 0 : copy(_II __first, _II __last, _OI __result)</span></a>
|
|
<a name="466"><span class="lineNum"> 466 </span> : : {</a>
|
|
<a name="467"><span class="lineNum"> 467 </span> : : // concept requirements</a>
|
|
<a name="468"><span class="lineNum"> 468 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_II>)</a>
|
|
<a name="469"><span class="lineNum"> 469 </span> : : __glibcxx_function_requires(_OutputIteratorConcept<_OI,</a>
|
|
<a name="470"><span class="lineNum"> 470 </span> : : typename iterator_traits<_II>::value_type>)</a>
|
|
<a name="471"><span class="lineNum"> 471 </span> : : __glibcxx_requires_can_increment_range(__first, __last, __result);</a>
|
|
<a name="472"><span class="lineNum"> 472 </span> : : </a>
|
|
<a name="473"><span class="lineNum"> 473 </span> : : return std::__copy_move_a2<__is_move_iterator<_II>::__value></a>
|
|
<a name="474"><span class="lineNum"> 474 </span> :<span class="lineNoCov"> 0 : (std::__miter_base(__first), std::__miter_base(__last), __result);</span></a>
|
|
<a name="475"><span class="lineNum"> 475 </span> : : }</a>
|
|
<a name="476"><span class="lineNum"> 476 </span> : : </a>
|
|
<a name="477"><span class="lineNum"> 477 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="478"><span class="lineNum"> 478 </span> : : /**</a>
|
|
<a name="479"><span class="lineNum"> 479 </span> : : * @brief Moves the range [first,last) into result.</a>
|
|
<a name="480"><span class="lineNum"> 480 </span> : : * @ingroup mutating_algorithms</a>
|
|
<a name="481"><span class="lineNum"> 481 </span> : : * @param __first An input iterator.</a>
|
|
<a name="482"><span class="lineNum"> 482 </span> : : * @param __last An input iterator.</a>
|
|
<a name="483"><span class="lineNum"> 483 </span> : : * @param __result An output iterator.</a>
|
|
<a name="484"><span class="lineNum"> 484 </span> : : * @return result + (last - first)</a>
|
|
<a name="485"><span class="lineNum"> 485 </span> : : *</a>
|
|
<a name="486"><span class="lineNum"> 486 </span> : : * This inline function will boil down to a call to @c memmove whenever</a>
|
|
<a name="487"><span class="lineNum"> 487 </span> : : * possible. Failing that, if random access iterators are passed, then the</a>
|
|
<a name="488"><span class="lineNum"> 488 </span> : : * loop count will be known (and therefore a candidate for compiler</a>
|
|
<a name="489"><span class="lineNum"> 489 </span> : : * optimizations such as unrolling). Result may not be contained within</a>
|
|
<a name="490"><span class="lineNum"> 490 </span> : : * [first,last); the move_backward function should be used instead.</a>
|
|
<a name="491"><span class="lineNum"> 491 </span> : : *</a>
|
|
<a name="492"><span class="lineNum"> 492 </span> : : * Note that the end of the output range is permitted to be contained</a>
|
|
<a name="493"><span class="lineNum"> 493 </span> : : * within [first,last).</a>
|
|
<a name="494"><span class="lineNum"> 494 </span> : : */</a>
|
|
<a name="495"><span class="lineNum"> 495 </span> : : template<typename _II, typename _OI></a>
|
|
<a name="496"><span class="lineNum"> 496 </span> : : inline _OI</a>
|
|
<a name="497"><span class="lineNum"> 497 </span> : : move(_II __first, _II __last, _OI __result)</a>
|
|
<a name="498"><span class="lineNum"> 498 </span> : : {</a>
|
|
<a name="499"><span class="lineNum"> 499 </span> : : // concept requirements</a>
|
|
<a name="500"><span class="lineNum"> 500 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_II>)</a>
|
|
<a name="501"><span class="lineNum"> 501 </span> : : __glibcxx_function_requires(_OutputIteratorConcept<_OI,</a>
|
|
<a name="502"><span class="lineNum"> 502 </span> : : typename iterator_traits<_II>::value_type>)</a>
|
|
<a name="503"><span class="lineNum"> 503 </span> : : __glibcxx_requires_can_increment_range(__first, __last, __result);</a>
|
|
<a name="504"><span class="lineNum"> 504 </span> : : </a>
|
|
<a name="505"><span class="lineNum"> 505 </span> : : return std::__copy_move_a2<true>(std::__miter_base(__first),</a>
|
|
<a name="506"><span class="lineNum"> 506 </span> : : std::__miter_base(__last), __result);</a>
|
|
<a name="507"><span class="lineNum"> 507 </span> : : }</a>
|
|
<a name="508"><span class="lineNum"> 508 </span> : : </a>
|
|
<a name="509"><span class="lineNum"> 509 </span> : : #define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::move(_Tp, _Up, _Vp)</a>
|
|
<a name="510"><span class="lineNum"> 510 </span> : : #else</a>
|
|
<a name="511"><span class="lineNum"> 511 </span> : : #define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::copy(_Tp, _Up, _Vp)</a>
|
|
<a name="512"><span class="lineNum"> 512 </span> : : #endif</a>
|
|
<a name="513"><span class="lineNum"> 513 </span> : : </a>
|
|
<a name="514"><span class="lineNum"> 514 </span> : : template<bool, bool, typename></a>
|
|
<a name="515"><span class="lineNum"> 515 </span> : : struct __copy_move_backward</a>
|
|
<a name="516"><span class="lineNum"> 516 </span> : : {</a>
|
|
<a name="517"><span class="lineNum"> 517 </span> : : template<typename _BI1, typename _BI2></a>
|
|
<a name="518"><span class="lineNum"> 518 </span> : : static _BI2</a>
|
|
<a name="519"><span class="lineNum"> 519 </span> : : __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)</a>
|
|
<a name="520"><span class="lineNum"> 520 </span> : : {</a>
|
|
<a name="521"><span class="lineNum"> 521 </span> : : while (__first != __last)</a>
|
|
<a name="522"><span class="lineNum"> 522 </span> : : *--__result = *--__last;</a>
|
|
<a name="523"><span class="lineNum"> 523 </span> : : return __result;</a>
|
|
<a name="524"><span class="lineNum"> 524 </span> : : }</a>
|
|
<a name="525"><span class="lineNum"> 525 </span> : : };</a>
|
|
<a name="526"><span class="lineNum"> 526 </span> : : </a>
|
|
<a name="527"><span class="lineNum"> 527 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="528"><span class="lineNum"> 528 </span> : : template<typename _Category></a>
|
|
<a name="529"><span class="lineNum"> 529 </span> : : struct __copy_move_backward<true, false, _Category></a>
|
|
<a name="530"><span class="lineNum"> 530 </span> : : {</a>
|
|
<a name="531"><span class="lineNum"> 531 </span> : : template<typename _BI1, typename _BI2></a>
|
|
<a name="532"><span class="lineNum"> 532 </span> : : static _BI2</a>
|
|
<a name="533"><span class="lineNum"> 533 </span> : : __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)</a>
|
|
<a name="534"><span class="lineNum"> 534 </span> : : {</a>
|
|
<a name="535"><span class="lineNum"> 535 </span> : : while (__first != __last)</a>
|
|
<a name="536"><span class="lineNum"> 536 </span> : : *--__result = std::move(*--__last);</a>
|
|
<a name="537"><span class="lineNum"> 537 </span> : : return __result;</a>
|
|
<a name="538"><span class="lineNum"> 538 </span> : : }</a>
|
|
<a name="539"><span class="lineNum"> 539 </span> : : };</a>
|
|
<a name="540"><span class="lineNum"> 540 </span> : : #endif</a>
|
|
<a name="541"><span class="lineNum"> 541 </span> : : </a>
|
|
<a name="542"><span class="lineNum"> 542 </span> : : template<></a>
|
|
<a name="543"><span class="lineNum"> 543 </span> : : struct __copy_move_backward<false, false, random_access_iterator_tag></a>
|
|
<a name="544"><span class="lineNum"> 544 </span> : : {</a>
|
|
<a name="545"><span class="lineNum"> 545 </span> : : template<typename _BI1, typename _BI2></a>
|
|
<a name="546"><span class="lineNum"> 546 </span> : : static _BI2</a>
|
|
<a name="547"><span class="lineNum"> 547 </span> : : __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)</a>
|
|
<a name="548"><span class="lineNum"> 548 </span> : : {</a>
|
|
<a name="549"><span class="lineNum"> 549 </span> : : typename iterator_traits<_BI1>::difference_type __n;</a>
|
|
<a name="550"><span class="lineNum"> 550 </span> : : for (__n = __last - __first; __n > 0; --__n)</a>
|
|
<a name="551"><span class="lineNum"> 551 </span> : : *--__result = *--__last;</a>
|
|
<a name="552"><span class="lineNum"> 552 </span> : : return __result;</a>
|
|
<a name="553"><span class="lineNum"> 553 </span> : : }</a>
|
|
<a name="554"><span class="lineNum"> 554 </span> : : };</a>
|
|
<a name="555"><span class="lineNum"> 555 </span> : : </a>
|
|
<a name="556"><span class="lineNum"> 556 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="557"><span class="lineNum"> 557 </span> : : template<></a>
|
|
<a name="558"><span class="lineNum"> 558 </span> : : struct __copy_move_backward<true, false, random_access_iterator_tag></a>
|
|
<a name="559"><span class="lineNum"> 559 </span> : : {</a>
|
|
<a name="560"><span class="lineNum"> 560 </span> : : template<typename _BI1, typename _BI2></a>
|
|
<a name="561"><span class="lineNum"> 561 </span> : : static _BI2</a>
|
|
<a name="562"><span class="lineNum"> 562 </span> : : __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)</a>
|
|
<a name="563"><span class="lineNum"> 563 </span> : : {</a>
|
|
<a name="564"><span class="lineNum"> 564 </span> : : typename iterator_traits<_BI1>::difference_type __n;</a>
|
|
<a name="565"><span class="lineNum"> 565 </span> : : for (__n = __last - __first; __n > 0; --__n)</a>
|
|
<a name="566"><span class="lineNum"> 566 </span> : : *--__result = std::move(*--__last);</a>
|
|
<a name="567"><span class="lineNum"> 567 </span> : : return __result;</a>
|
|
<a name="568"><span class="lineNum"> 568 </span> : : }</a>
|
|
<a name="569"><span class="lineNum"> 569 </span> : : };</a>
|
|
<a name="570"><span class="lineNum"> 570 </span> : : #endif</a>
|
|
<a name="571"><span class="lineNum"> 571 </span> : : </a>
|
|
<a name="572"><span class="lineNum"> 572 </span> : : template<bool _IsMove></a>
|
|
<a name="573"><span class="lineNum"> 573 </span> : : struct __copy_move_backward<_IsMove, true, random_access_iterator_tag></a>
|
|
<a name="574"><span class="lineNum"> 574 </span> : : {</a>
|
|
<a name="575"><span class="lineNum"> 575 </span> : : template<typename _Tp></a>
|
|
<a name="576"><span class="lineNum"> 576 </span> : : static _Tp*</a>
|
|
<a name="577"><span class="lineNum"> 577 </span> :<span class="lineNoCov"> 0 : __copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result)</span></a>
|
|
<a name="578"><span class="lineNum"> 578 </span> : : {</a>
|
|
<a name="579"><span class="lineNum"> 579 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="580"><span class="lineNum"> 580 </span> : : using __assignable = conditional<_IsMove,</a>
|
|
<a name="581"><span class="lineNum"> 581 </span> : : is_move_assignable<_Tp>,</a>
|
|
<a name="582"><span class="lineNum"> 582 </span> : : is_copy_assignable<_Tp>>;</a>
|
|
<a name="583"><span class="lineNum"> 583 </span> : : // trivial types can have deleted assignment</a>
|
|
<a name="584"><span class="lineNum"> 584 </span> : : static_assert( __assignable::type::value, "type is not assignable" );</a>
|
|
<a name="585"><span class="lineNum"> 585 </span> : : #endif</a>
|
|
<a name="586"><span class="lineNum"> 586 </span> :<span class="lineNoCov"> 0 : const ptrdiff_t _Num = __last - __first;</span></a>
|
|
<a name="587"><span class="lineNum"> 587 </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 : if (_Num)</span></a>
|
|
<a name="588"><span class="lineNum"> 588 </span> :<span class="lineNoCov"> 0 : __builtin_memmove(__result - _Num, __first, sizeof(_Tp) * _Num);</span></a>
|
|
<a name="589"><span class="lineNum"> 589 </span> :<span class="lineNoCov"> 0 : return __result - _Num;</span></a>
|
|
<a name="590"><span class="lineNum"> 590 </span> : : }</a>
|
|
<a name="591"><span class="lineNum"> 591 </span> : : };</a>
|
|
<a name="592"><span class="lineNum"> 592 </span> : : </a>
|
|
<a name="593"><span class="lineNum"> 593 </span> : : template<bool _IsMove, typename _BI1, typename _BI2></a>
|
|
<a name="594"><span class="lineNum"> 594 </span> : : inline _BI2</a>
|
|
<a name="595"><span class="lineNum"> 595 </span> :<span class="lineNoCov"> 0 : __copy_move_backward_a(_BI1 __first, _BI1 __last, _BI2 __result)</span></a>
|
|
<a name="596"><span class="lineNum"> 596 </span> : : {</a>
|
|
<a name="597"><span class="lineNum"> 597 </span> : : typedef typename iterator_traits<_BI1>::value_type _ValueType1;</a>
|
|
<a name="598"><span class="lineNum"> 598 </span> : : typedef typename iterator_traits<_BI2>::value_type _ValueType2;</a>
|
|
<a name="599"><span class="lineNum"> 599 </span> : : typedef typename iterator_traits<_BI1>::iterator_category _Category;</a>
|
|
<a name="600"><span class="lineNum"> 600 </span> :<span class="lineNoCov"> 0 : const bool __simple = (__is_trivially_copyable(_ValueType1)</span></a>
|
|
<a name="601"><span class="lineNum"> 601 </span> : : && __is_pointer<_BI1>::__value</a>
|
|
<a name="602"><span class="lineNum"> 602 </span> : : && __is_pointer<_BI2>::__value</a>
|
|
<a name="603"><span class="lineNum"> 603 </span> : : && __are_same<_ValueType1, _ValueType2>::__value);</a>
|
|
<a name="604"><span class="lineNum"> 604 </span> : : </a>
|
|
<a name="605"><span class="lineNum"> 605 </span> : : return std::__copy_move_backward<_IsMove, __simple,</a>
|
|
<a name="606"><span class="lineNum"> 606 </span> :<span class="lineNoCov"> 0 : _Category>::__copy_move_b(__first,</span></a>
|
|
<a name="607"><span class="lineNum"> 607 </span> : : __last,</a>
|
|
<a name="608"><span class="lineNum"> 608 </span> :<span class="lineNoCov"> 0 : __result);</span></a>
|
|
<a name="609"><span class="lineNum"> 609 </span> : : }</a>
|
|
<a name="610"><span class="lineNum"> 610 </span> : : </a>
|
|
<a name="611"><span class="lineNum"> 611 </span> : : template<bool _IsMove, typename _BI1, typename _BI2></a>
|
|
<a name="612"><span class="lineNum"> 612 </span> : : inline _BI2</a>
|
|
<a name="613"><span class="lineNum"> 613 </span> :<span class="lineNoCov"> 0 : __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)</span></a>
|
|
<a name="614"><span class="lineNum"> 614 </span> : : {</a>
|
|
<a name="615"><span class="lineNum"> 615 </span> :<span class="lineNoCov"> 0 : return std::__niter_wrap(__result,</span></a>
|
|
<a name="616"><span class="lineNum"> 616 </span> : : std::__copy_move_backward_a<_IsMove></a>
|
|
<a name="617"><span class="lineNum"> 617 </span> : : (std::__niter_base(__first), std::__niter_base(__last),</a>
|
|
<a name="618"><span class="lineNum"> 618 </span> :<span class="lineNoCov"> 0 : std::__niter_base(__result)));</span></a>
|
|
<a name="619"><span class="lineNum"> 619 </span> : : }</a>
|
|
<a name="620"><span class="lineNum"> 620 </span> : : </a>
|
|
<a name="621"><span class="lineNum"> 621 </span> : : /**</a>
|
|
<a name="622"><span class="lineNum"> 622 </span> : : * @brief Copies the range [first,last) into result.</a>
|
|
<a name="623"><span class="lineNum"> 623 </span> : : * @ingroup mutating_algorithms</a>
|
|
<a name="624"><span class="lineNum"> 624 </span> : : * @param __first A bidirectional iterator.</a>
|
|
<a name="625"><span class="lineNum"> 625 </span> : : * @param __last A bidirectional iterator.</a>
|
|
<a name="626"><span class="lineNum"> 626 </span> : : * @param __result A bidirectional iterator.</a>
|
|
<a name="627"><span class="lineNum"> 627 </span> : : * @return result - (last - first)</a>
|
|
<a name="628"><span class="lineNum"> 628 </span> : : *</a>
|
|
<a name="629"><span class="lineNum"> 629 </span> : : * The function has the same effect as copy, but starts at the end of the</a>
|
|
<a name="630"><span class="lineNum"> 630 </span> : : * range and works its way to the start, returning the start of the result.</a>
|
|
<a name="631"><span class="lineNum"> 631 </span> : : * This inline function will boil down to a call to @c memmove whenever</a>
|
|
<a name="632"><span class="lineNum"> 632 </span> : : * possible. Failing that, if random access iterators are passed, then the</a>
|
|
<a name="633"><span class="lineNum"> 633 </span> : : * loop count will be known (and therefore a candidate for compiler</a>
|
|
<a name="634"><span class="lineNum"> 634 </span> : : * optimizations such as unrolling).</a>
|
|
<a name="635"><span class="lineNum"> 635 </span> : : *</a>
|
|
<a name="636"><span class="lineNum"> 636 </span> : : * Result may not be in the range (first,last]. Use copy instead. Note</a>
|
|
<a name="637"><span class="lineNum"> 637 </span> : : * that the start of the output range may overlap [first,last).</a>
|
|
<a name="638"><span class="lineNum"> 638 </span> : : */</a>
|
|
<a name="639"><span class="lineNum"> 639 </span> : : template<typename _BI1, typename _BI2></a>
|
|
<a name="640"><span class="lineNum"> 640 </span> : : inline _BI2</a>
|
|
<a name="641"><span class="lineNum"> 641 </span> : : copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)</a>
|
|
<a name="642"><span class="lineNum"> 642 </span> : : {</a>
|
|
<a name="643"><span class="lineNum"> 643 </span> : : // concept requirements</a>
|
|
<a name="644"><span class="lineNum"> 644 </span> : : __glibcxx_function_requires(_BidirectionalIteratorConcept<_BI1>)</a>
|
|
<a name="645"><span class="lineNum"> 645 </span> : : __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>)</a>
|
|
<a name="646"><span class="lineNum"> 646 </span> : : __glibcxx_function_requires(_ConvertibleConcept<</a>
|
|
<a name="647"><span class="lineNum"> 647 </span> : : typename iterator_traits<_BI1>::value_type,</a>
|
|
<a name="648"><span class="lineNum"> 648 </span> : : typename iterator_traits<_BI2>::value_type>)</a>
|
|
<a name="649"><span class="lineNum"> 649 </span> : : __glibcxx_requires_can_decrement_range(__first, __last, __result);</a>
|
|
<a name="650"><span class="lineNum"> 650 </span> : : </a>
|
|
<a name="651"><span class="lineNum"> 651 </span> : : return std::__copy_move_backward_a2<__is_move_iterator<_BI1>::__value></a>
|
|
<a name="652"><span class="lineNum"> 652 </span> : : (std::__miter_base(__first), std::__miter_base(__last), __result);</a>
|
|
<a name="653"><span class="lineNum"> 653 </span> : : }</a>
|
|
<a name="654"><span class="lineNum"> 654 </span> : : </a>
|
|
<a name="655"><span class="lineNum"> 655 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="656"><span class="lineNum"> 656 </span> : : /**</a>
|
|
<a name="657"><span class="lineNum"> 657 </span> : : * @brief Moves the range [first,last) into result.</a>
|
|
<a name="658"><span class="lineNum"> 658 </span> : : * @ingroup mutating_algorithms</a>
|
|
<a name="659"><span class="lineNum"> 659 </span> : : * @param __first A bidirectional iterator.</a>
|
|
<a name="660"><span class="lineNum"> 660 </span> : : * @param __last A bidirectional iterator.</a>
|
|
<a name="661"><span class="lineNum"> 661 </span> : : * @param __result A bidirectional iterator.</a>
|
|
<a name="662"><span class="lineNum"> 662 </span> : : * @return result - (last - first)</a>
|
|
<a name="663"><span class="lineNum"> 663 </span> : : *</a>
|
|
<a name="664"><span class="lineNum"> 664 </span> : : * The function has the same effect as move, but starts at the end of the</a>
|
|
<a name="665"><span class="lineNum"> 665 </span> : : * range and works its way to the start, returning the start of the result.</a>
|
|
<a name="666"><span class="lineNum"> 666 </span> : : * This inline function will boil down to a call to @c memmove whenever</a>
|
|
<a name="667"><span class="lineNum"> 667 </span> : : * possible. Failing that, if random access iterators are passed, then the</a>
|
|
<a name="668"><span class="lineNum"> 668 </span> : : * loop count will be known (and therefore a candidate for compiler</a>
|
|
<a name="669"><span class="lineNum"> 669 </span> : : * optimizations such as unrolling).</a>
|
|
<a name="670"><span class="lineNum"> 670 </span> : : *</a>
|
|
<a name="671"><span class="lineNum"> 671 </span> : : * Result may not be in the range (first,last]. Use move instead. Note</a>
|
|
<a name="672"><span class="lineNum"> 672 </span> : : * that the start of the output range may overlap [first,last).</a>
|
|
<a name="673"><span class="lineNum"> 673 </span> : : */</a>
|
|
<a name="674"><span class="lineNum"> 674 </span> : : template<typename _BI1, typename _BI2></a>
|
|
<a name="675"><span class="lineNum"> 675 </span> : : inline _BI2</a>
|
|
<a name="676"><span class="lineNum"> 676 </span> :<span class="lineNoCov"> 0 : move_backward(_BI1 __first, _BI1 __last, _BI2 __result)</span></a>
|
|
<a name="677"><span class="lineNum"> 677 </span> : : {</a>
|
|
<a name="678"><span class="lineNum"> 678 </span> : : // concept requirements</a>
|
|
<a name="679"><span class="lineNum"> 679 </span> : : __glibcxx_function_requires(_BidirectionalIteratorConcept<_BI1>)</a>
|
|
<a name="680"><span class="lineNum"> 680 </span> : : __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>)</a>
|
|
<a name="681"><span class="lineNum"> 681 </span> : : __glibcxx_function_requires(_ConvertibleConcept<</a>
|
|
<a name="682"><span class="lineNum"> 682 </span> : : typename iterator_traits<_BI1>::value_type,</a>
|
|
<a name="683"><span class="lineNum"> 683 </span> : : typename iterator_traits<_BI2>::value_type>)</a>
|
|
<a name="684"><span class="lineNum"> 684 </span> : : __glibcxx_requires_can_decrement_range(__first, __last, __result);</a>
|
|
<a name="685"><span class="lineNum"> 685 </span> : : </a>
|
|
<a name="686"><span class="lineNum"> 686 </span> :<span class="lineNoCov"> 0 : return std::__copy_move_backward_a2<true>(std::__miter_base(__first),</span></a>
|
|
<a name="687"><span class="lineNum"> 687 </span> : : std::__miter_base(__last),</a>
|
|
<a name="688"><span class="lineNum"> 688 </span> :<span class="lineNoCov"> 0 : __result);</span></a>
|
|
<a name="689"><span class="lineNum"> 689 </span> : : }</a>
|
|
<a name="690"><span class="lineNum"> 690 </span> : : </a>
|
|
<a name="691"><span class="lineNum"> 691 </span> : : #define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::move_backward(_Tp, _Up, _Vp)</a>
|
|
<a name="692"><span class="lineNum"> 692 </span> : : #else</a>
|
|
<a name="693"><span class="lineNum"> 693 </span> : : #define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::copy_backward(_Tp, _Up, _Vp)</a>
|
|
<a name="694"><span class="lineNum"> 694 </span> : : #endif</a>
|
|
<a name="695"><span class="lineNum"> 695 </span> : : </a>
|
|
<a name="696"><span class="lineNum"> 696 </span> : : template<typename _ForwardIterator, typename _Tp></a>
|
|
<a name="697"><span class="lineNum"> 697 </span> : : inline typename</a>
|
|
<a name="698"><span class="lineNum"> 698 </span> : : __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type</a>
|
|
<a name="699"><span class="lineNum"> 699 </span> : : __fill_a(_ForwardIterator __first, _ForwardIterator __last,</a>
|
|
<a name="700"><span class="lineNum"> 700 </span> : : const _Tp& __value)</a>
|
|
<a name="701"><span class="lineNum"> 701 </span> : : {</a>
|
|
<a name="702"><span class="lineNum"> 702 </span> : : for (; __first != __last; ++__first)</a>
|
|
<a name="703"><span class="lineNum"> 703 </span> : : *__first = __value;</a>
|
|
<a name="704"><span class="lineNum"> 704 </span> : : }</a>
|
|
<a name="705"><span class="lineNum"> 705 </span> : : </a>
|
|
<a name="706"><span class="lineNum"> 706 </span> : : template<typename _ForwardIterator, typename _Tp></a>
|
|
<a name="707"><span class="lineNum"> 707 </span> : : inline typename</a>
|
|
<a name="708"><span class="lineNum"> 708 </span> : : __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type</a>
|
|
<a name="709"><span class="lineNum"> 709 </span> : : __fill_a(_ForwardIterator __first, _ForwardIterator __last,</a>
|
|
<a name="710"><span class="lineNum"> 710 </span> : : const _Tp& __value)</a>
|
|
<a name="711"><span class="lineNum"> 711 </span> : : {</a>
|
|
<a name="712"><span class="lineNum"> 712 </span> : : const _Tp __tmp = __value;</a>
|
|
<a name="713"><span class="lineNum"> 713 </span> : : for (; __first != __last; ++__first)</a>
|
|
<a name="714"><span class="lineNum"> 714 </span> : : *__first = __tmp;</a>
|
|
<a name="715"><span class="lineNum"> 715 </span> : : }</a>
|
|
<a name="716"><span class="lineNum"> 716 </span> : : </a>
|
|
<a name="717"><span class="lineNum"> 717 </span> : : // Specialization: for char types we can use memset.</a>
|
|
<a name="718"><span class="lineNum"> 718 </span> : : template<typename _Tp></a>
|
|
<a name="719"><span class="lineNum"> 719 </span> : : inline typename</a>
|
|
<a name="720"><span class="lineNum"> 720 </span> : : __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type</a>
|
|
<a name="721"><span class="lineNum"> 721 </span> : : __fill_a(_Tp* __first, _Tp* __last, const _Tp& __c)</a>
|
|
<a name="722"><span class="lineNum"> 722 </span> : : {</a>
|
|
<a name="723"><span class="lineNum"> 723 </span> : : const _Tp __tmp = __c;</a>
|
|
<a name="724"><span class="lineNum"> 724 </span> : : if (const size_t __len = __last - __first)</a>
|
|
<a name="725"><span class="lineNum"> 725 </span> : : __builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);</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> : : /**</a>
|
|
<a name="729"><span class="lineNum"> 729 </span> : : * @brief Fills the range [first,last) with copies of value.</a>
|
|
<a name="730"><span class="lineNum"> 730 </span> : : * @ingroup mutating_algorithms</a>
|
|
<a name="731"><span class="lineNum"> 731 </span> : : * @param __first A forward iterator.</a>
|
|
<a name="732"><span class="lineNum"> 732 </span> : : * @param __last A forward iterator.</a>
|
|
<a name="733"><span class="lineNum"> 733 </span> : : * @param __value A reference-to-const of arbitrary type.</a>
|
|
<a name="734"><span class="lineNum"> 734 </span> : : * @return Nothing.</a>
|
|
<a name="735"><span class="lineNum"> 735 </span> : : *</a>
|
|
<a name="736"><span class="lineNum"> 736 </span> : : * This function fills a range with copies of the same value. For char</a>
|
|
<a name="737"><span class="lineNum"> 737 </span> : : * types filling contiguous areas of memory, this becomes an inline call</a>
|
|
<a name="738"><span class="lineNum"> 738 </span> : : * to @c memset or @c wmemset.</a>
|
|
<a name="739"><span class="lineNum"> 739 </span> : : */</a>
|
|
<a name="740"><span class="lineNum"> 740 </span> : : template<typename _ForwardIterator, typename _Tp></a>
|
|
<a name="741"><span class="lineNum"> 741 </span> : : inline void</a>
|
|
<a name="742"><span class="lineNum"> 742 </span> : : fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)</a>
|
|
<a name="743"><span class="lineNum"> 743 </span> : : {</a>
|
|
<a name="744"><span class="lineNum"> 744 </span> : : // concept requirements</a>
|
|
<a name="745"><span class="lineNum"> 745 </span> : : __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<</a>
|
|
<a name="746"><span class="lineNum"> 746 </span> : : _ForwardIterator>)</a>
|
|
<a name="747"><span class="lineNum"> 747 </span> : : __glibcxx_requires_valid_range(__first, __last);</a>
|
|
<a name="748"><span class="lineNum"> 748 </span> : : </a>
|
|
<a name="749"><span class="lineNum"> 749 </span> : : std::__fill_a(std::__niter_base(__first), std::__niter_base(__last),</a>
|
|
<a name="750"><span class="lineNum"> 750 </span> : : __value);</a>
|
|
<a name="751"><span class="lineNum"> 751 </span> : : }</a>
|
|
<a name="752"><span class="lineNum"> 752 </span> : : </a>
|
|
<a name="753"><span class="lineNum"> 753 </span> : : template<typename _OutputIterator, typename _Size, typename _Tp></a>
|
|
<a name="754"><span class="lineNum"> 754 </span> : : inline typename</a>
|
|
<a name="755"><span class="lineNum"> 755 </span> : : __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type</a>
|
|
<a name="756"><span class="lineNum"> 756 </span> : : __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)</a>
|
|
<a name="757"><span class="lineNum"> 757 </span> : : {</a>
|
|
<a name="758"><span class="lineNum"> 758 </span> : : for (__decltype(__n + 0) __niter = __n;</a>
|
|
<a name="759"><span class="lineNum"> 759 </span> : : __niter > 0; --__niter, (void) ++__first)</a>
|
|
<a name="760"><span class="lineNum"> 760 </span> : : *__first = __value;</a>
|
|
<a name="761"><span class="lineNum"> 761 </span> : : return __first;</a>
|
|
<a name="762"><span class="lineNum"> 762 </span> : : }</a>
|
|
<a name="763"><span class="lineNum"> 763 </span> : : </a>
|
|
<a name="764"><span class="lineNum"> 764 </span> : : template<typename _OutputIterator, typename _Size, typename _Tp></a>
|
|
<a name="765"><span class="lineNum"> 765 </span> : : inline typename</a>
|
|
<a name="766"><span class="lineNum"> 766 </span> : : __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type</a>
|
|
<a name="767"><span class="lineNum"> 767 </span> :<span class="lineNoCov"> 0 : __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)</span></a>
|
|
<a name="768"><span class="lineNum"> 768 </span> : : {</a>
|
|
<a name="769"><span class="lineNum"> 769 </span> :<span class="lineNoCov"> 0 : const _Tp __tmp = __value;</span></a>
|
|
<a name="770"><span class="lineNum"> 770 </span> :<span class="lineNoCov"> 0 : for (__decltype(__n + 0) __niter = __n;</span></a>
|
|
<a name="771"><span class="lineNum"> 771 </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 : __niter > 0; --__niter, (void) ++__first)</span></a>
|
|
<a name="772"><span class="lineNum"> 772 </span> :<span class="lineNoCov"> 0 : *__first = __tmp;</span></a>
|
|
<a name="773"><span class="lineNum"> 773 </span> :<span class="lineNoCov"> 0 : return __first;</span></a>
|
|
<a name="774"><span class="lineNum"> 774 </span> : : }</a>
|
|
<a name="775"><span class="lineNum"> 775 </span> : : </a>
|
|
<a name="776"><span class="lineNum"> 776 </span> : : template<typename _Size, typename _Tp></a>
|
|
<a name="777"><span class="lineNum"> 777 </span> : : inline typename</a>
|
|
<a name="778"><span class="lineNum"> 778 </span> : : __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, _Tp*>::__type</a>
|
|
<a name="779"><span class="lineNum"> 779 </span> : : __fill_n_a(_Tp* __first, _Size __n, const _Tp& __c)</a>
|
|
<a name="780"><span class="lineNum"> 780 </span> : : {</a>
|
|
<a name="781"><span class="lineNum"> 781 </span> : : std::__fill_a(__first, __first + __n, __c);</a>
|
|
<a name="782"><span class="lineNum"> 782 </span> : : return __first + __n;</a>
|
|
<a name="783"><span class="lineNum"> 783 </span> : : }</a>
|
|
<a name="784"><span class="lineNum"> 784 </span> : : </a>
|
|
<a name="785"><span class="lineNum"> 785 </span> : : /**</a>
|
|
<a name="786"><span class="lineNum"> 786 </span> : : * @brief Fills the range [first,first+n) with copies of value.</a>
|
|
<a name="787"><span class="lineNum"> 787 </span> : : * @ingroup mutating_algorithms</a>
|
|
<a name="788"><span class="lineNum"> 788 </span> : : * @param __first An output iterator.</a>
|
|
<a name="789"><span class="lineNum"> 789 </span> : : * @param __n The count of copies to perform.</a>
|
|
<a name="790"><span class="lineNum"> 790 </span> : : * @param __value A reference-to-const of arbitrary type.</a>
|
|
<a name="791"><span class="lineNum"> 791 </span> : : * @return The iterator at first+n.</a>
|
|
<a name="792"><span class="lineNum"> 792 </span> : : *</a>
|
|
<a name="793"><span class="lineNum"> 793 </span> : : * This function fills a range with copies of the same value. For char</a>
|
|
<a name="794"><span class="lineNum"> 794 </span> : : * types filling contiguous areas of memory, this becomes an inline call</a>
|
|
<a name="795"><span class="lineNum"> 795 </span> : : * to @c memset or @ wmemset.</a>
|
|
<a name="796"><span class="lineNum"> 796 </span> : : *</a>
|
|
<a name="797"><span class="lineNum"> 797 </span> : : * _GLIBCXX_RESOLVE_LIB_DEFECTS</a>
|
|
<a name="798"><span class="lineNum"> 798 </span> : : * DR 865. More algorithms that throw away information</a>
|
|
<a name="799"><span class="lineNum"> 799 </span> : : */</a>
|
|
<a name="800"><span class="lineNum"> 800 </span> : : template<typename _OI, typename _Size, typename _Tp></a>
|
|
<a name="801"><span class="lineNum"> 801 </span> : : inline _OI</a>
|
|
<a name="802"><span class="lineNum"> 802 </span> :<span class="lineNoCov"> 0 : fill_n(_OI __first, _Size __n, const _Tp& __value)</span></a>
|
|
<a name="803"><span class="lineNum"> 803 </span> : : {</a>
|
|
<a name="804"><span class="lineNum"> 804 </span> : : // concept requirements</a>
|
|
<a name="805"><span class="lineNum"> 805 </span> : : __glibcxx_function_requires(_OutputIteratorConcept<_OI, _Tp>)</a>
|
|
<a name="806"><span class="lineNum"> 806 </span> : : __glibcxx_requires_can_increment(__first, __n);</a>
|
|
<a name="807"><span class="lineNum"> 807 </span> : : </a>
|
|
<a name="808"><span class="lineNum"> 808 </span> :<span class="lineNoCov"> 0 : return std::__niter_wrap(__first,</span></a>
|
|
<a name="809"><span class="lineNum"> 809 </span> :<span class="lineNoCov"> 0 : std::__fill_n_a(std::__niter_base(__first), __n, __value));</span></a>
|
|
<a name="810"><span class="lineNum"> 810 </span> : : }</a>
|
|
<a name="811"><span class="lineNum"> 811 </span> : : </a>
|
|
<a name="812"><span class="lineNum"> 812 </span> : : template<bool _BoolType></a>
|
|
<a name="813"><span class="lineNum"> 813 </span> : : struct __equal</a>
|
|
<a name="814"><span class="lineNum"> 814 </span> : : {</a>
|
|
<a name="815"><span class="lineNum"> 815 </span> : : template<typename _II1, typename _II2></a>
|
|
<a name="816"><span class="lineNum"> 816 </span> : : static bool</a>
|
|
<a name="817"><span class="lineNum"> 817 </span> : : equal(_II1 __first1, _II1 __last1, _II2 __first2)</a>
|
|
<a name="818"><span class="lineNum"> 818 </span> : : {</a>
|
|
<a name="819"><span class="lineNum"> 819 </span> : : for (; __first1 != __last1; ++__first1, (void) ++__first2)</a>
|
|
<a name="820"><span class="lineNum"> 820 </span> : : if (!(*__first1 == *__first2))</a>
|
|
<a name="821"><span class="lineNum"> 821 </span> : : return false;</a>
|
|
<a name="822"><span class="lineNum"> 822 </span> : : return true;</a>
|
|
<a name="823"><span class="lineNum"> 823 </span> : : }</a>
|
|
<a name="824"><span class="lineNum"> 824 </span> : : };</a>
|
|
<a name="825"><span class="lineNum"> 825 </span> : : </a>
|
|
<a name="826"><span class="lineNum"> 826 </span> : : template<></a>
|
|
<a name="827"><span class="lineNum"> 827 </span> : : struct __equal<true></a>
|
|
<a name="828"><span class="lineNum"> 828 </span> : : {</a>
|
|
<a name="829"><span class="lineNum"> 829 </span> : : template<typename _Tp></a>
|
|
<a name="830"><span class="lineNum"> 830 </span> : : static bool</a>
|
|
<a name="831"><span class="lineNum"> 831 </span> : : equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2)</a>
|
|
<a name="832"><span class="lineNum"> 832 </span> : : {</a>
|
|
<a name="833"><span class="lineNum"> 833 </span> : : if (const size_t __len = (__last1 - __first1))</a>
|
|
<a name="834"><span class="lineNum"> 834 </span> : : return !__builtin_memcmp(__first1, __first2, sizeof(_Tp) * __len);</a>
|
|
<a name="835"><span class="lineNum"> 835 </span> : : return true;</a>
|
|
<a name="836"><span class="lineNum"> 836 </span> : : }</a>
|
|
<a name="837"><span class="lineNum"> 837 </span> : : };</a>
|
|
<a name="838"><span class="lineNum"> 838 </span> : : </a>
|
|
<a name="839"><span class="lineNum"> 839 </span> : : template<typename _II1, typename _II2></a>
|
|
<a name="840"><span class="lineNum"> 840 </span> : : inline bool</a>
|
|
<a name="841"><span class="lineNum"> 841 </span> : : __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)</a>
|
|
<a name="842"><span class="lineNum"> 842 </span> : : {</a>
|
|
<a name="843"><span class="lineNum"> 843 </span> : : typedef typename iterator_traits<_II1>::value_type _ValueType1;</a>
|
|
<a name="844"><span class="lineNum"> 844 </span> : : typedef typename iterator_traits<_II2>::value_type _ValueType2;</a>
|
|
<a name="845"><span class="lineNum"> 845 </span> : : const bool __simple = ((__is_integer<_ValueType1>::__value</a>
|
|
<a name="846"><span class="lineNum"> 846 </span> : : || __is_pointer<_ValueType1>::__value)</a>
|
|
<a name="847"><span class="lineNum"> 847 </span> : : && __is_pointer<_II1>::__value</a>
|
|
<a name="848"><span class="lineNum"> 848 </span> : : && __is_pointer<_II2>::__value</a>
|
|
<a name="849"><span class="lineNum"> 849 </span> : : && __are_same<_ValueType1, _ValueType2>::__value);</a>
|
|
<a name="850"><span class="lineNum"> 850 </span> : : </a>
|
|
<a name="851"><span class="lineNum"> 851 </span> : : return std::__equal<__simple>::equal(__first1, __last1, __first2);</a>
|
|
<a name="852"><span class="lineNum"> 852 </span> : : }</a>
|
|
<a name="853"><span class="lineNum"> 853 </span> : : </a>
|
|
<a name="854"><span class="lineNum"> 854 </span> : : template<typename, typename></a>
|
|
<a name="855"><span class="lineNum"> 855 </span> : : struct __lc_rai</a>
|
|
<a name="856"><span class="lineNum"> 856 </span> : : {</a>
|
|
<a name="857"><span class="lineNum"> 857 </span> : : template<typename _II1, typename _II2></a>
|
|
<a name="858"><span class="lineNum"> 858 </span> : : static _II1</a>
|
|
<a name="859"><span class="lineNum"> 859 </span> : : __newlast1(_II1, _II1 __last1, _II2, _II2)</a>
|
|
<a name="860"><span class="lineNum"> 860 </span> : : { return __last1; }</a>
|
|
<a name="861"><span class="lineNum"> 861 </span> : : </a>
|
|
<a name="862"><span class="lineNum"> 862 </span> : : template<typename _II></a>
|
|
<a name="863"><span class="lineNum"> 863 </span> : : static bool</a>
|
|
<a name="864"><span class="lineNum"> 864 </span> : : __cnd2(_II __first, _II __last)</a>
|
|
<a name="865"><span class="lineNum"> 865 </span> : : { return __first != __last; }</a>
|
|
<a name="866"><span class="lineNum"> 866 </span> : : };</a>
|
|
<a name="867"><span class="lineNum"> 867 </span> : : </a>
|
|
<a name="868"><span class="lineNum"> 868 </span> : : template<></a>
|
|
<a name="869"><span class="lineNum"> 869 </span> : : struct __lc_rai<random_access_iterator_tag, random_access_iterator_tag></a>
|
|
<a name="870"><span class="lineNum"> 870 </span> : : {</a>
|
|
<a name="871"><span class="lineNum"> 871 </span> : : template<typename _RAI1, typename _RAI2></a>
|
|
<a name="872"><span class="lineNum"> 872 </span> : : static _RAI1</a>
|
|
<a name="873"><span class="lineNum"> 873 </span> : : __newlast1(_RAI1 __first1, _RAI1 __last1,</a>
|
|
<a name="874"><span class="lineNum"> 874 </span> : : _RAI2 __first2, _RAI2 __last2)</a>
|
|
<a name="875"><span class="lineNum"> 875 </span> : : {</a>
|
|
<a name="876"><span class="lineNum"> 876 </span> : : const typename iterator_traits<_RAI1>::difference_type</a>
|
|
<a name="877"><span class="lineNum"> 877 </span> : : __diff1 = __last1 - __first1;</a>
|
|
<a name="878"><span class="lineNum"> 878 </span> : : const typename iterator_traits<_RAI2>::difference_type</a>
|
|
<a name="879"><span class="lineNum"> 879 </span> : : __diff2 = __last2 - __first2;</a>
|
|
<a name="880"><span class="lineNum"> 880 </span> : : return __diff2 < __diff1 ? __first1 + __diff2 : __last1;</a>
|
|
<a name="881"><span class="lineNum"> 881 </span> : : }</a>
|
|
<a name="882"><span class="lineNum"> 882 </span> : : </a>
|
|
<a name="883"><span class="lineNum"> 883 </span> : : template<typename _RAI></a>
|
|
<a name="884"><span class="lineNum"> 884 </span> : : static bool</a>
|
|
<a name="885"><span class="lineNum"> 885 </span> : : __cnd2(_RAI, _RAI)</a>
|
|
<a name="886"><span class="lineNum"> 886 </span> : : { return true; }</a>
|
|
<a name="887"><span class="lineNum"> 887 </span> : : };</a>
|
|
<a name="888"><span class="lineNum"> 888 </span> : : </a>
|
|
<a name="889"><span class="lineNum"> 889 </span> : : template<typename _II1, typename _II2, typename _Compare></a>
|
|
<a name="890"><span class="lineNum"> 890 </span> : : bool</a>
|
|
<a name="891"><span class="lineNum"> 891 </span> : : __lexicographical_compare_impl(_II1 __first1, _II1 __last1,</a>
|
|
<a name="892"><span class="lineNum"> 892 </span> : : _II2 __first2, _II2 __last2,</a>
|
|
<a name="893"><span class="lineNum"> 893 </span> : : _Compare __comp)</a>
|
|
<a name="894"><span class="lineNum"> 894 </span> : : {</a>
|
|
<a name="895"><span class="lineNum"> 895 </span> : : typedef typename iterator_traits<_II1>::iterator_category _Category1;</a>
|
|
<a name="896"><span class="lineNum"> 896 </span> : : typedef typename iterator_traits<_II2>::iterator_category _Category2;</a>
|
|
<a name="897"><span class="lineNum"> 897 </span> : : typedef std::__lc_rai<_Category1, _Category2> __rai_type;</a>
|
|
<a name="898"><span class="lineNum"> 898 </span> : : </a>
|
|
<a name="899"><span class="lineNum"> 899 </span> : : __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);</a>
|
|
<a name="900"><span class="lineNum"> 900 </span> : : for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);</a>
|
|
<a name="901"><span class="lineNum"> 901 </span> : : ++__first1, (void)++__first2)</a>
|
|
<a name="902"><span class="lineNum"> 902 </span> : : {</a>
|
|
<a name="903"><span class="lineNum"> 903 </span> : : if (__comp(__first1, __first2))</a>
|
|
<a name="904"><span class="lineNum"> 904 </span> : : return true;</a>
|
|
<a name="905"><span class="lineNum"> 905 </span> : : if (__comp(__first2, __first1))</a>
|
|
<a name="906"><span class="lineNum"> 906 </span> : : return false;</a>
|
|
<a name="907"><span class="lineNum"> 907 </span> : : }</a>
|
|
<a name="908"><span class="lineNum"> 908 </span> : : return __first1 == __last1 && __first2 != __last2;</a>
|
|
<a name="909"><span class="lineNum"> 909 </span> : : }</a>
|
|
<a name="910"><span class="lineNum"> 910 </span> : : </a>
|
|
<a name="911"><span class="lineNum"> 911 </span> : : template<bool _BoolType></a>
|
|
<a name="912"><span class="lineNum"> 912 </span> : : struct __lexicographical_compare</a>
|
|
<a name="913"><span class="lineNum"> 913 </span> : : {</a>
|
|
<a name="914"><span class="lineNum"> 914 </span> : : template<typename _II1, typename _II2></a>
|
|
<a name="915"><span class="lineNum"> 915 </span> : : static bool __lc(_II1, _II1, _II2, _II2);</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> : : template<bool _BoolType></a>
|
|
<a name="919"><span class="lineNum"> 919 </span> : : template<typename _II1, typename _II2></a>
|
|
<a name="920"><span class="lineNum"> 920 </span> : : bool</a>
|
|
<a name="921"><span class="lineNum"> 921 </span> : : __lexicographical_compare<_BoolType>::</a>
|
|
<a name="922"><span class="lineNum"> 922 </span> : : __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)</a>
|
|
<a name="923"><span class="lineNum"> 923 </span> : : {</a>
|
|
<a name="924"><span class="lineNum"> 924 </span> : : return std::__lexicographical_compare_impl(__first1, __last1,</a>
|
|
<a name="925"><span class="lineNum"> 925 </span> : : __first2, __last2,</a>
|
|
<a name="926"><span class="lineNum"> 926 </span> : : __gnu_cxx::__ops::__iter_less_iter());</a>
|
|
<a name="927"><span class="lineNum"> 927 </span> : : }</a>
|
|
<a name="928"><span class="lineNum"> 928 </span> : : </a>
|
|
<a name="929"><span class="lineNum"> 929 </span> : : template<></a>
|
|
<a name="930"><span class="lineNum"> 930 </span> : : struct __lexicographical_compare<true></a>
|
|
<a name="931"><span class="lineNum"> 931 </span> : : {</a>
|
|
<a name="932"><span class="lineNum"> 932 </span> : : template<typename _Tp, typename _Up></a>
|
|
<a name="933"><span class="lineNum"> 933 </span> : : static bool</a>
|
|
<a name="934"><span class="lineNum"> 934 </span> : : __lc(const _Tp* __first1, const _Tp* __last1,</a>
|
|
<a name="935"><span class="lineNum"> 935 </span> : : const _Up* __first2, const _Up* __last2)</a>
|
|
<a name="936"><span class="lineNum"> 936 </span> : : {</a>
|
|
<a name="937"><span class="lineNum"> 937 </span> : : const size_t __len1 = __last1 - __first1;</a>
|
|
<a name="938"><span class="lineNum"> 938 </span> : : const size_t __len2 = __last2 - __first2;</a>
|
|
<a name="939"><span class="lineNum"> 939 </span> : : if (const size_t __len = std::min(__len1, __len2))</a>
|
|
<a name="940"><span class="lineNum"> 940 </span> : : if (int __result = __builtin_memcmp(__first1, __first2, __len))</a>
|
|
<a name="941"><span class="lineNum"> 941 </span> : : return __result < 0;</a>
|
|
<a name="942"><span class="lineNum"> 942 </span> : : return __len1 < __len2;</a>
|
|
<a name="943"><span class="lineNum"> 943 </span> : : }</a>
|
|
<a name="944"><span class="lineNum"> 944 </span> : : };</a>
|
|
<a name="945"><span class="lineNum"> 945 </span> : : </a>
|
|
<a name="946"><span class="lineNum"> 946 </span> : : template<typename _II1, typename _II2></a>
|
|
<a name="947"><span class="lineNum"> 947 </span> : : inline bool</a>
|
|
<a name="948"><span class="lineNum"> 948 </span> : : __lexicographical_compare_aux(_II1 __first1, _II1 __last1,</a>
|
|
<a name="949"><span class="lineNum"> 949 </span> : : _II2 __first2, _II2 __last2)</a>
|
|
<a name="950"><span class="lineNum"> 950 </span> : : {</a>
|
|
<a name="951"><span class="lineNum"> 951 </span> : : typedef typename iterator_traits<_II1>::value_type _ValueType1;</a>
|
|
<a name="952"><span class="lineNum"> 952 </span> : : typedef typename iterator_traits<_II2>::value_type _ValueType2;</a>
|
|
<a name="953"><span class="lineNum"> 953 </span> : : const bool __simple =</a>
|
|
<a name="954"><span class="lineNum"> 954 </span> : : (__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value</a>
|
|
<a name="955"><span class="lineNum"> 955 </span> : : && !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed</a>
|
|
<a name="956"><span class="lineNum"> 956 </span> : : && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed</a>
|
|
<a name="957"><span class="lineNum"> 957 </span> : : && __is_pointer<_II1>::__value</a>
|
|
<a name="958"><span class="lineNum"> 958 </span> : : && __is_pointer<_II2>::__value);</a>
|
|
<a name="959"><span class="lineNum"> 959 </span> : : </a>
|
|
<a name="960"><span class="lineNum"> 960 </span> : : return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,</a>
|
|
<a name="961"><span class="lineNum"> 961 </span> : : __first2, __last2);</a>
|
|
<a name="962"><span class="lineNum"> 962 </span> : : }</a>
|
|
<a name="963"><span class="lineNum"> 963 </span> : : </a>
|
|
<a name="964"><span class="lineNum"> 964 </span> : : template<typename _ForwardIterator, typename _Tp, typename _Compare></a>
|
|
<a name="965"><span class="lineNum"> 965 </span> : : _ForwardIterator</a>
|
|
<a name="966"><span class="lineNum"> 966 </span> : : __lower_bound(_ForwardIterator __first, _ForwardIterator __last,</a>
|
|
<a name="967"><span class="lineNum"> 967 </span> : : const _Tp& __val, _Compare __comp)</a>
|
|
<a name="968"><span class="lineNum"> 968 </span> : : {</a>
|
|
<a name="969"><span class="lineNum"> 969 </span> : : typedef typename iterator_traits<_ForwardIterator>::difference_type</a>
|
|
<a name="970"><span class="lineNum"> 970 </span> : : _DistanceType;</a>
|
|
<a name="971"><span class="lineNum"> 971 </span> : : </a>
|
|
<a name="972"><span class="lineNum"> 972 </span> : : _DistanceType __len = std::distance(__first, __last);</a>
|
|
<a name="973"><span class="lineNum"> 973 </span> : : </a>
|
|
<a name="974"><span class="lineNum"> 974 </span> : : while (__len > 0)</a>
|
|
<a name="975"><span class="lineNum"> 975 </span> : : {</a>
|
|
<a name="976"><span class="lineNum"> 976 </span> : : _DistanceType __half = __len >> 1;</a>
|
|
<a name="977"><span class="lineNum"> 977 </span> : : _ForwardIterator __middle = __first;</a>
|
|
<a name="978"><span class="lineNum"> 978 </span> : : std::advance(__middle, __half);</a>
|
|
<a name="979"><span class="lineNum"> 979 </span> : : if (__comp(__middle, __val))</a>
|
|
<a name="980"><span class="lineNum"> 980 </span> : : {</a>
|
|
<a name="981"><span class="lineNum"> 981 </span> : : __first = __middle;</a>
|
|
<a name="982"><span class="lineNum"> 982 </span> : : ++__first;</a>
|
|
<a name="983"><span class="lineNum"> 983 </span> : : __len = __len - __half - 1;</a>
|
|
<a name="984"><span class="lineNum"> 984 </span> : : }</a>
|
|
<a name="985"><span class="lineNum"> 985 </span> : : else</a>
|
|
<a name="986"><span class="lineNum"> 986 </span> : : __len = __half;</a>
|
|
<a name="987"><span class="lineNum"> 987 </span> : : }</a>
|
|
<a name="988"><span class="lineNum"> 988 </span> : : return __first;</a>
|
|
<a name="989"><span class="lineNum"> 989 </span> : : }</a>
|
|
<a name="990"><span class="lineNum"> 990 </span> : : </a>
|
|
<a name="991"><span class="lineNum"> 991 </span> : : /**</a>
|
|
<a name="992"><span class="lineNum"> 992 </span> : : * @brief Finds the first position in which @a val could be inserted</a>
|
|
<a name="993"><span class="lineNum"> 993 </span> : : * without changing the ordering.</a>
|
|
<a name="994"><span class="lineNum"> 994 </span> : : * @param __first An iterator.</a>
|
|
<a name="995"><span class="lineNum"> 995 </span> : : * @param __last Another iterator.</a>
|
|
<a name="996"><span class="lineNum"> 996 </span> : : * @param __val The search term.</a>
|
|
<a name="997"><span class="lineNum"> 997 </span> : : * @return An iterator pointing to the first element <em>not less</a>
|
|
<a name="998"><span class="lineNum"> 998 </span> : : * than</em> @a val, or end() if every element is less than</a>
|
|
<a name="999"><span class="lineNum"> 999 </span> : : * @a val.</a>
|
|
<a name="1000"><span class="lineNum"> 1000 </span> : : * @ingroup binary_search_algorithms</a>
|
|
<a name="1001"><span class="lineNum"> 1001 </span> : : */</a>
|
|
<a name="1002"><span class="lineNum"> 1002 </span> : : template<typename _ForwardIterator, typename _Tp></a>
|
|
<a name="1003"><span class="lineNum"> 1003 </span> : : inline _ForwardIterator</a>
|
|
<a name="1004"><span class="lineNum"> 1004 </span> : : lower_bound(_ForwardIterator __first, _ForwardIterator __last,</a>
|
|
<a name="1005"><span class="lineNum"> 1005 </span> : : const _Tp& __val)</a>
|
|
<a name="1006"><span class="lineNum"> 1006 </span> : : {</a>
|
|
<a name="1007"><span class="lineNum"> 1007 </span> : : // concept requirements</a>
|
|
<a name="1008"><span class="lineNum"> 1008 </span> : : __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)</a>
|
|
<a name="1009"><span class="lineNum"> 1009 </span> : : __glibcxx_function_requires(_LessThanOpConcept<</a>
|
|
<a name="1010"><span class="lineNum"> 1010 </span> : : typename iterator_traits<_ForwardIterator>::value_type, _Tp>)</a>
|
|
<a name="1011"><span class="lineNum"> 1011 </span> : : __glibcxx_requires_partitioned_lower(__first, __last, __val);</a>
|
|
<a name="1012"><span class="lineNum"> 1012 </span> : : </a>
|
|
<a name="1013"><span class="lineNum"> 1013 </span> : : return std::__lower_bound(__first, __last, __val,</a>
|
|
<a name="1014"><span class="lineNum"> 1014 </span> : : __gnu_cxx::__ops::__iter_less_val());</a>
|
|
<a name="1015"><span class="lineNum"> 1015 </span> : : }</a>
|
|
<a name="1016"><span class="lineNum"> 1016 </span> : : </a>
|
|
<a name="1017"><span class="lineNum"> 1017 </span> : : /// This is a helper function for the sort routines and for random.tcc.</a>
|
|
<a name="1018"><span class="lineNum"> 1018 </span> : : // Precondition: __n > 0.</a>
|
|
<a name="1019"><span class="lineNum"> 1019 </span> : : inline _GLIBCXX_CONSTEXPR int</a>
|
|
<a name="1020"><span class="lineNum"> 1020 </span> : : __lg(int __n)</a>
|
|
<a name="1021"><span class="lineNum"> 1021 </span> : : { return (int)sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }</a>
|
|
<a name="1022"><span class="lineNum"> 1022 </span> : : </a>
|
|
<a name="1023"><span class="lineNum"> 1023 </span> : : inline _GLIBCXX_CONSTEXPR unsigned</a>
|
|
<a name="1024"><span class="lineNum"> 1024 </span> : : __lg(unsigned __n)</a>
|
|
<a name="1025"><span class="lineNum"> 1025 </span> : : { return (int)sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }</a>
|
|
<a name="1026"><span class="lineNum"> 1026 </span> : : </a>
|
|
<a name="1027"><span class="lineNum"> 1027 </span> : : inline _GLIBCXX_CONSTEXPR long</a>
|
|
<a name="1028"><span class="lineNum"> 1028 </span> : : __lg(long __n)</a>
|
|
<a name="1029"><span class="lineNum"> 1029 </span> : : { return (int)sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }</a>
|
|
<a name="1030"><span class="lineNum"> 1030 </span> : : </a>
|
|
<a name="1031"><span class="lineNum"> 1031 </span> : : inline _GLIBCXX_CONSTEXPR unsigned long</a>
|
|
<a name="1032"><span class="lineNum"> 1032 </span> : : __lg(unsigned long __n)</a>
|
|
<a name="1033"><span class="lineNum"> 1033 </span> : : { return (int)sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }</a>
|
|
<a name="1034"><span class="lineNum"> 1034 </span> : : </a>
|
|
<a name="1035"><span class="lineNum"> 1035 </span> : : inline _GLIBCXX_CONSTEXPR long long</a>
|
|
<a name="1036"><span class="lineNum"> 1036 </span> : : __lg(long long __n)</a>
|
|
<a name="1037"><span class="lineNum"> 1037 </span> : : { return (int)sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }</a>
|
|
<a name="1038"><span class="lineNum"> 1038 </span> : : </a>
|
|
<a name="1039"><span class="lineNum"> 1039 </span> : : inline _GLIBCXX_CONSTEXPR unsigned long long</a>
|
|
<a name="1040"><span class="lineNum"> 1040 </span> : : __lg(unsigned long long __n)</a>
|
|
<a name="1041"><span class="lineNum"> 1041 </span> : : { return (int)sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }</a>
|
|
<a name="1042"><span class="lineNum"> 1042 </span> : : </a>
|
|
<a name="1043"><span class="lineNum"> 1043 </span> : : _GLIBCXX_BEGIN_NAMESPACE_ALGO</a>
|
|
<a name="1044"><span class="lineNum"> 1044 </span> : : </a>
|
|
<a name="1045"><span class="lineNum"> 1045 </span> : : /**</a>
|
|
<a name="1046"><span class="lineNum"> 1046 </span> : : * @brief Tests a range for element-wise equality.</a>
|
|
<a name="1047"><span class="lineNum"> 1047 </span> : : * @ingroup non_mutating_algorithms</a>
|
|
<a name="1048"><span class="lineNum"> 1048 </span> : : * @param __first1 An input iterator.</a>
|
|
<a name="1049"><span class="lineNum"> 1049 </span> : : * @param __last1 An input iterator.</a>
|
|
<a name="1050"><span class="lineNum"> 1050 </span> : : * @param __first2 An input iterator.</a>
|
|
<a name="1051"><span class="lineNum"> 1051 </span> : : * @return A boolean true or false.</a>
|
|
<a name="1052"><span class="lineNum"> 1052 </span> : : *</a>
|
|
<a name="1053"><span class="lineNum"> 1053 </span> : : * This compares the elements of two ranges using @c == and returns true or</a>
|
|
<a name="1054"><span class="lineNum"> 1054 </span> : : * false depending on whether all of the corresponding elements of the</a>
|
|
<a name="1055"><span class="lineNum"> 1055 </span> : : * ranges are equal.</a>
|
|
<a name="1056"><span class="lineNum"> 1056 </span> : : */</a>
|
|
<a name="1057"><span class="lineNum"> 1057 </span> : : template<typename _II1, typename _II2></a>
|
|
<a name="1058"><span class="lineNum"> 1058 </span> : : inline bool</a>
|
|
<a name="1059"><span class="lineNum"> 1059 </span> : : equal(_II1 __first1, _II1 __last1, _II2 __first2)</a>
|
|
<a name="1060"><span class="lineNum"> 1060 </span> : : {</a>
|
|
<a name="1061"><span class="lineNum"> 1061 </span> : : // concept requirements</a>
|
|
<a name="1062"><span class="lineNum"> 1062 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_II1>)</a>
|
|
<a name="1063"><span class="lineNum"> 1063 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_II2>)</a>
|
|
<a name="1064"><span class="lineNum"> 1064 </span> : : __glibcxx_function_requires(_EqualOpConcept<</a>
|
|
<a name="1065"><span class="lineNum"> 1065 </span> : : typename iterator_traits<_II1>::value_type,</a>
|
|
<a name="1066"><span class="lineNum"> 1066 </span> : : typename iterator_traits<_II2>::value_type>)</a>
|
|
<a name="1067"><span class="lineNum"> 1067 </span> : : __glibcxx_requires_can_increment_range(__first1, __last1, __first2);</a>
|
|
<a name="1068"><span class="lineNum"> 1068 </span> : : </a>
|
|
<a name="1069"><span class="lineNum"> 1069 </span> : : return std::__equal_aux(std::__niter_base(__first1),</a>
|
|
<a name="1070"><span class="lineNum"> 1070 </span> : : std::__niter_base(__last1),</a>
|
|
<a name="1071"><span class="lineNum"> 1071 </span> : : std::__niter_base(__first2));</a>
|
|
<a name="1072"><span class="lineNum"> 1072 </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 Tests a range for element-wise equality.</a>
|
|
<a name="1076"><span class="lineNum"> 1076 </span> : : * @ingroup non_mutating_algorithms</a>
|
|
<a name="1077"><span class="lineNum"> 1077 </span> : : * @param __first1 An input iterator.</a>
|
|
<a name="1078"><span class="lineNum"> 1078 </span> : : * @param __last1 An input iterator.</a>
|
|
<a name="1079"><span class="lineNum"> 1079 </span> : : * @param __first2 An input iterator.</a>
|
|
<a name="1080"><span class="lineNum"> 1080 </span> : : * @param __binary_pred A binary predicate @link functors</a>
|
|
<a name="1081"><span class="lineNum"> 1081 </span> : : * functor@endlink.</a>
|
|
<a name="1082"><span class="lineNum"> 1082 </span> : : * @return A boolean true or false.</a>
|
|
<a name="1083"><span class="lineNum"> 1083 </span> : : *</a>
|
|
<a name="1084"><span class="lineNum"> 1084 </span> : : * This compares the elements of two ranges using the binary_pred</a>
|
|
<a name="1085"><span class="lineNum"> 1085 </span> : : * parameter, and returns true or</a>
|
|
<a name="1086"><span class="lineNum"> 1086 </span> : : * false depending on whether all of the corresponding elements of the</a>
|
|
<a name="1087"><span class="lineNum"> 1087 </span> : : * ranges are equal.</a>
|
|
<a name="1088"><span class="lineNum"> 1088 </span> : : */</a>
|
|
<a name="1089"><span class="lineNum"> 1089 </span> : : template<typename _IIter1, typename _IIter2, typename _BinaryPredicate></a>
|
|
<a name="1090"><span class="lineNum"> 1090 </span> : : inline bool</a>
|
|
<a name="1091"><span class="lineNum"> 1091 </span> : : equal(_IIter1 __first1, _IIter1 __last1,</a>
|
|
<a name="1092"><span class="lineNum"> 1092 </span> : : _IIter2 __first2, _BinaryPredicate __binary_pred)</a>
|
|
<a name="1093"><span class="lineNum"> 1093 </span> : : {</a>
|
|
<a name="1094"><span class="lineNum"> 1094 </span> : : // concept requirements</a>
|
|
<a name="1095"><span class="lineNum"> 1095 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_IIter1>)</a>
|
|
<a name="1096"><span class="lineNum"> 1096 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_IIter2>)</a>
|
|
<a name="1097"><span class="lineNum"> 1097 </span> : : __glibcxx_requires_valid_range(__first1, __last1);</a>
|
|
<a name="1098"><span class="lineNum"> 1098 </span> : : </a>
|
|
<a name="1099"><span class="lineNum"> 1099 </span> : : for (; __first1 != __last1; ++__first1, (void)++__first2)</a>
|
|
<a name="1100"><span class="lineNum"> 1100 </span> : : if (!bool(__binary_pred(*__first1, *__first2)))</a>
|
|
<a name="1101"><span class="lineNum"> 1101 </span> : : return false;</a>
|
|
<a name="1102"><span class="lineNum"> 1102 </span> : : return true;</a>
|
|
<a name="1103"><span class="lineNum"> 1103 </span> : : }</a>
|
|
<a name="1104"><span class="lineNum"> 1104 </span> : : </a>
|
|
<a name="1105"><span class="lineNum"> 1105 </span> : : #if __cplusplus >= 201103L</a>
|
|
<a name="1106"><span class="lineNum"> 1106 </span> : : // 4-iterator version of std::equal<It1, It2> for use in C++11.</a>
|
|
<a name="1107"><span class="lineNum"> 1107 </span> : : template<typename _II1, typename _II2></a>
|
|
<a name="1108"><span class="lineNum"> 1108 </span> : : inline bool</a>
|
|
<a name="1109"><span class="lineNum"> 1109 </span> : : __equal4(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)</a>
|
|
<a name="1110"><span class="lineNum"> 1110 </span> : : {</a>
|
|
<a name="1111"><span class="lineNum"> 1111 </span> : : using _RATag = random_access_iterator_tag;</a>
|
|
<a name="1112"><span class="lineNum"> 1112 </span> : : using _Cat1 = typename iterator_traits<_II1>::iterator_category;</a>
|
|
<a name="1113"><span class="lineNum"> 1113 </span> : : using _Cat2 = typename iterator_traits<_II2>::iterator_category;</a>
|
|
<a name="1114"><span class="lineNum"> 1114 </span> : : using _RAIters = __and_<is_same<_Cat1, _RATag>, is_same<_Cat2, _RATag>>;</a>
|
|
<a name="1115"><span class="lineNum"> 1115 </span> : : if (_RAIters())</a>
|
|
<a name="1116"><span class="lineNum"> 1116 </span> : : {</a>
|
|
<a name="1117"><span class="lineNum"> 1117 </span> : : auto __d1 = std::distance(__first1, __last1);</a>
|
|
<a name="1118"><span class="lineNum"> 1118 </span> : : auto __d2 = std::distance(__first2, __last2);</a>
|
|
<a name="1119"><span class="lineNum"> 1119 </span> : : if (__d1 != __d2)</a>
|
|
<a name="1120"><span class="lineNum"> 1120 </span> : : return false;</a>
|
|
<a name="1121"><span class="lineNum"> 1121 </span> : : return _GLIBCXX_STD_A::equal(__first1, __last1, __first2);</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> : : for (; __first1 != __last1 && __first2 != __last2;</a>
|
|
<a name="1125"><span class="lineNum"> 1125 </span> : : ++__first1, (void)++__first2)</a>
|
|
<a name="1126"><span class="lineNum"> 1126 </span> : : if (!(*__first1 == *__first2))</a>
|
|
<a name="1127"><span class="lineNum"> 1127 </span> : : return false;</a>
|
|
<a name="1128"><span class="lineNum"> 1128 </span> : : return __first1 == __last1 && __first2 == __last2;</a>
|
|
<a name="1129"><span class="lineNum"> 1129 </span> : : }</a>
|
|
<a name="1130"><span class="lineNum"> 1130 </span> : : </a>
|
|
<a name="1131"><span class="lineNum"> 1131 </span> : : // 4-iterator version of std::equal<It1, It2, BinaryPred> for use in C++11.</a>
|
|
<a name="1132"><span class="lineNum"> 1132 </span> : : template<typename _II1, typename _II2, typename _BinaryPredicate></a>
|
|
<a name="1133"><span class="lineNum"> 1133 </span> : : inline bool</a>
|
|
<a name="1134"><span class="lineNum"> 1134 </span> : : __equal4(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2,</a>
|
|
<a name="1135"><span class="lineNum"> 1135 </span> : : _BinaryPredicate __binary_pred)</a>
|
|
<a name="1136"><span class="lineNum"> 1136 </span> : : {</a>
|
|
<a name="1137"><span class="lineNum"> 1137 </span> : : using _RATag = random_access_iterator_tag;</a>
|
|
<a name="1138"><span class="lineNum"> 1138 </span> : : using _Cat1 = typename iterator_traits<_II1>::iterator_category;</a>
|
|
<a name="1139"><span class="lineNum"> 1139 </span> : : using _Cat2 = typename iterator_traits<_II2>::iterator_category;</a>
|
|
<a name="1140"><span class="lineNum"> 1140 </span> : : using _RAIters = __and_<is_same<_Cat1, _RATag>, is_same<_Cat2, _RATag>>;</a>
|
|
<a name="1141"><span class="lineNum"> 1141 </span> : : if (_RAIters())</a>
|
|
<a name="1142"><span class="lineNum"> 1142 </span> : : {</a>
|
|
<a name="1143"><span class="lineNum"> 1143 </span> : : auto __d1 = std::distance(__first1, __last1);</a>
|
|
<a name="1144"><span class="lineNum"> 1144 </span> : : auto __d2 = std::distance(__first2, __last2);</a>
|
|
<a name="1145"><span class="lineNum"> 1145 </span> : : if (__d1 != __d2)</a>
|
|
<a name="1146"><span class="lineNum"> 1146 </span> : : return false;</a>
|
|
<a name="1147"><span class="lineNum"> 1147 </span> : : return _GLIBCXX_STD_A::equal(__first1, __last1, __first2,</a>
|
|
<a name="1148"><span class="lineNum"> 1148 </span> : : __binary_pred);</a>
|
|
<a name="1149"><span class="lineNum"> 1149 </span> : : }</a>
|
|
<a name="1150"><span class="lineNum"> 1150 </span> : : </a>
|
|
<a name="1151"><span class="lineNum"> 1151 </span> : : for (; __first1 != __last1 && __first2 != __last2;</a>
|
|
<a name="1152"><span class="lineNum"> 1152 </span> : : ++__first1, (void)++__first2)</a>
|
|
<a name="1153"><span class="lineNum"> 1153 </span> : : if (!bool(__binary_pred(*__first1, *__first2)))</a>
|
|
<a name="1154"><span class="lineNum"> 1154 </span> : : return false;</a>
|
|
<a name="1155"><span class="lineNum"> 1155 </span> : : return __first1 == __last1 && __first2 == __last2;</a>
|
|
<a name="1156"><span class="lineNum"> 1156 </span> : : }</a>
|
|
<a name="1157"><span class="lineNum"> 1157 </span> : : #endif // C++11</a>
|
|
<a name="1158"><span class="lineNum"> 1158 </span> : : </a>
|
|
<a name="1159"><span class="lineNum"> 1159 </span> : : #if __cplusplus > 201103L</a>
|
|
<a name="1160"><span class="lineNum"> 1160 </span> : : </a>
|
|
<a name="1161"><span class="lineNum"> 1161 </span> : : #define __cpp_lib_robust_nonmodifying_seq_ops 201304</a>
|
|
<a name="1162"><span class="lineNum"> 1162 </span> : : </a>
|
|
<a name="1163"><span class="lineNum"> 1163 </span> : : /**</a>
|
|
<a name="1164"><span class="lineNum"> 1164 </span> : : * @brief Tests a range for element-wise equality.</a>
|
|
<a name="1165"><span class="lineNum"> 1165 </span> : : * @ingroup non_mutating_algorithms</a>
|
|
<a name="1166"><span class="lineNum"> 1166 </span> : : * @param __first1 An input iterator.</a>
|
|
<a name="1167"><span class="lineNum"> 1167 </span> : : * @param __last1 An input iterator.</a>
|
|
<a name="1168"><span class="lineNum"> 1168 </span> : : * @param __first2 An input iterator.</a>
|
|
<a name="1169"><span class="lineNum"> 1169 </span> : : * @param __last2 An input iterator.</a>
|
|
<a name="1170"><span class="lineNum"> 1170 </span> : : * @return A boolean true or false.</a>
|
|
<a name="1171"><span class="lineNum"> 1171 </span> : : *</a>
|
|
<a name="1172"><span class="lineNum"> 1172 </span> : : * This compares the elements of two ranges using @c == and returns true or</a>
|
|
<a name="1173"><span class="lineNum"> 1173 </span> : : * false depending on whether all of the corresponding elements of the</a>
|
|
<a name="1174"><span class="lineNum"> 1174 </span> : : * ranges are equal.</a>
|
|
<a name="1175"><span class="lineNum"> 1175 </span> : : */</a>
|
|
<a name="1176"><span class="lineNum"> 1176 </span> : : template<typename _II1, typename _II2></a>
|
|
<a name="1177"><span class="lineNum"> 1177 </span> : : inline bool</a>
|
|
<a name="1178"><span class="lineNum"> 1178 </span> : : equal(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)</a>
|
|
<a name="1179"><span class="lineNum"> 1179 </span> : : {</a>
|
|
<a name="1180"><span class="lineNum"> 1180 </span> : : // concept requirements</a>
|
|
<a name="1181"><span class="lineNum"> 1181 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_II1>)</a>
|
|
<a name="1182"><span class="lineNum"> 1182 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_II2>)</a>
|
|
<a name="1183"><span class="lineNum"> 1183 </span> : : __glibcxx_function_requires(_EqualOpConcept<</a>
|
|
<a name="1184"><span class="lineNum"> 1184 </span> : : typename iterator_traits<_II1>::value_type,</a>
|
|
<a name="1185"><span class="lineNum"> 1185 </span> : : typename iterator_traits<_II2>::value_type>)</a>
|
|
<a name="1186"><span class="lineNum"> 1186 </span> : : __glibcxx_requires_valid_range(__first1, __last1);</a>
|
|
<a name="1187"><span class="lineNum"> 1187 </span> : : __glibcxx_requires_valid_range(__first2, __last2);</a>
|
|
<a name="1188"><span class="lineNum"> 1188 </span> : : </a>
|
|
<a name="1189"><span class="lineNum"> 1189 </span> : : return _GLIBCXX_STD_A::__equal4(__first1, __last1, __first2, __last2);</a>
|
|
<a name="1190"><span class="lineNum"> 1190 </span> : : }</a>
|
|
<a name="1191"><span class="lineNum"> 1191 </span> : : </a>
|
|
<a name="1192"><span class="lineNum"> 1192 </span> : : /**</a>
|
|
<a name="1193"><span class="lineNum"> 1193 </span> : : * @brief Tests a range for element-wise equality.</a>
|
|
<a name="1194"><span class="lineNum"> 1194 </span> : : * @ingroup non_mutating_algorithms</a>
|
|
<a name="1195"><span class="lineNum"> 1195 </span> : : * @param __first1 An input iterator.</a>
|
|
<a name="1196"><span class="lineNum"> 1196 </span> : : * @param __last1 An input iterator.</a>
|
|
<a name="1197"><span class="lineNum"> 1197 </span> : : * @param __first2 An input iterator.</a>
|
|
<a name="1198"><span class="lineNum"> 1198 </span> : : * @param __last2 An input iterator.</a>
|
|
<a name="1199"><span class="lineNum"> 1199 </span> : : * @param __binary_pred A binary predicate @link functors</a>
|
|
<a name="1200"><span class="lineNum"> 1200 </span> : : * functor@endlink.</a>
|
|
<a name="1201"><span class="lineNum"> 1201 </span> : : * @return A boolean true or false.</a>
|
|
<a name="1202"><span class="lineNum"> 1202 </span> : : *</a>
|
|
<a name="1203"><span class="lineNum"> 1203 </span> : : * This compares the elements of two ranges using the binary_pred</a>
|
|
<a name="1204"><span class="lineNum"> 1204 </span> : : * parameter, and returns true or</a>
|
|
<a name="1205"><span class="lineNum"> 1205 </span> : : * false depending on whether all of the corresponding elements of the</a>
|
|
<a name="1206"><span class="lineNum"> 1206 </span> : : * ranges are equal.</a>
|
|
<a name="1207"><span class="lineNum"> 1207 </span> : : */</a>
|
|
<a name="1208"><span class="lineNum"> 1208 </span> : : template<typename _IIter1, typename _IIter2, typename _BinaryPredicate></a>
|
|
<a name="1209"><span class="lineNum"> 1209 </span> : : inline bool</a>
|
|
<a name="1210"><span class="lineNum"> 1210 </span> : : equal(_IIter1 __first1, _IIter1 __last1,</a>
|
|
<a name="1211"><span class="lineNum"> 1211 </span> : : _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred)</a>
|
|
<a name="1212"><span class="lineNum"> 1212 </span> : : {</a>
|
|
<a name="1213"><span class="lineNum"> 1213 </span> : : // concept requirements</a>
|
|
<a name="1214"><span class="lineNum"> 1214 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_IIter1>)</a>
|
|
<a name="1215"><span class="lineNum"> 1215 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_IIter2>)</a>
|
|
<a name="1216"><span class="lineNum"> 1216 </span> : : __glibcxx_requires_valid_range(__first1, __last1);</a>
|
|
<a name="1217"><span class="lineNum"> 1217 </span> : : __glibcxx_requires_valid_range(__first2, __last2);</a>
|
|
<a name="1218"><span class="lineNum"> 1218 </span> : : </a>
|
|
<a name="1219"><span class="lineNum"> 1219 </span> : : return _GLIBCXX_STD_A::__equal4(__first1, __last1, __first2, __last2,</a>
|
|
<a name="1220"><span class="lineNum"> 1220 </span> : : __binary_pred);</a>
|
|
<a name="1221"><span class="lineNum"> 1221 </span> : : }</a>
|
|
<a name="1222"><span class="lineNum"> 1222 </span> : : #endif // C++14</a>
|
|
<a name="1223"><span class="lineNum"> 1223 </span> : : </a>
|
|
<a name="1224"><span class="lineNum"> 1224 </span> : : /**</a>
|
|
<a name="1225"><span class="lineNum"> 1225 </span> : : * @brief Performs @b dictionary comparison on ranges.</a>
|
|
<a name="1226"><span class="lineNum"> 1226 </span> : : * @ingroup sorting_algorithms</a>
|
|
<a name="1227"><span class="lineNum"> 1227 </span> : : * @param __first1 An input iterator.</a>
|
|
<a name="1228"><span class="lineNum"> 1228 </span> : : * @param __last1 An input iterator.</a>
|
|
<a name="1229"><span class="lineNum"> 1229 </span> : : * @param __first2 An input iterator.</a>
|
|
<a name="1230"><span class="lineNum"> 1230 </span> : : * @param __last2 An input iterator.</a>
|
|
<a name="1231"><span class="lineNum"> 1231 </span> : : * @return A boolean true or false.</a>
|
|
<a name="1232"><span class="lineNum"> 1232 </span> : : *</a>
|
|
<a name="1233"><span class="lineNum"> 1233 </span> : : * <em>Returns true if the sequence of elements defined by the range</a>
|
|
<a name="1234"><span class="lineNum"> 1234 </span> : : * [first1,last1) is lexicographically less than the sequence of elements</a>
|
|
<a name="1235"><span class="lineNum"> 1235 </span> : : * defined by the range [first2,last2). Returns false otherwise.</em></a>
|
|
<a name="1236"><span class="lineNum"> 1236 </span> : : * (Quoted from [25.3.8]/1.) If the iterators are all character pointers,</a>
|
|
<a name="1237"><span class="lineNum"> 1237 </span> : : * then this is an inline call to @c memcmp.</a>
|
|
<a name="1238"><span class="lineNum"> 1238 </span> : : */</a>
|
|
<a name="1239"><span class="lineNum"> 1239 </span> : : template<typename _II1, typename _II2></a>
|
|
<a name="1240"><span class="lineNum"> 1240 </span> : : inline bool</a>
|
|
<a name="1241"><span class="lineNum"> 1241 </span> : : lexicographical_compare(_II1 __first1, _II1 __last1,</a>
|
|
<a name="1242"><span class="lineNum"> 1242 </span> : : _II2 __first2, _II2 __last2)</a>
|
|
<a name="1243"><span class="lineNum"> 1243 </span> : : {</a>
|
|
<a name="1244"><span class="lineNum"> 1244 </span> : : #ifdef _GLIBCXX_CONCEPT_CHECKS</a>
|
|
<a name="1245"><span class="lineNum"> 1245 </span> : : // concept requirements</a>
|
|
<a name="1246"><span class="lineNum"> 1246 </span> : : typedef typename iterator_traits<_II1>::value_type _ValueType1;</a>
|
|
<a name="1247"><span class="lineNum"> 1247 </span> : : typedef typename iterator_traits<_II2>::value_type _ValueType2;</a>
|
|
<a name="1248"><span class="lineNum"> 1248 </span> : : #endif</a>
|
|
<a name="1249"><span class="lineNum"> 1249 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_II1>)</a>
|
|
<a name="1250"><span class="lineNum"> 1250 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_II2>)</a>
|
|
<a name="1251"><span class="lineNum"> 1251 </span> : : __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)</a>
|
|
<a name="1252"><span class="lineNum"> 1252 </span> : : __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)</a>
|
|
<a name="1253"><span class="lineNum"> 1253 </span> : : __glibcxx_requires_valid_range(__first1, __last1);</a>
|
|
<a name="1254"><span class="lineNum"> 1254 </span> : : __glibcxx_requires_valid_range(__first2, __last2);</a>
|
|
<a name="1255"><span class="lineNum"> 1255 </span> : : </a>
|
|
<a name="1256"><span class="lineNum"> 1256 </span> : : return std::__lexicographical_compare_aux(std::__niter_base(__first1),</a>
|
|
<a name="1257"><span class="lineNum"> 1257 </span> : : std::__niter_base(__last1),</a>
|
|
<a name="1258"><span class="lineNum"> 1258 </span> : : std::__niter_base(__first2),</a>
|
|
<a name="1259"><span class="lineNum"> 1259 </span> : : std::__niter_base(__last2));</a>
|
|
<a name="1260"><span class="lineNum"> 1260 </span> : : }</a>
|
|
<a name="1261"><span class="lineNum"> 1261 </span> : : </a>
|
|
<a name="1262"><span class="lineNum"> 1262 </span> : : /**</a>
|
|
<a name="1263"><span class="lineNum"> 1263 </span> : : * @brief Performs @b dictionary comparison on ranges.</a>
|
|
<a name="1264"><span class="lineNum"> 1264 </span> : : * @ingroup sorting_algorithms</a>
|
|
<a name="1265"><span class="lineNum"> 1265 </span> : : * @param __first1 An input iterator.</a>
|
|
<a name="1266"><span class="lineNum"> 1266 </span> : : * @param __last1 An input iterator.</a>
|
|
<a name="1267"><span class="lineNum"> 1267 </span> : : * @param __first2 An input iterator.</a>
|
|
<a name="1268"><span class="lineNum"> 1268 </span> : : * @param __last2 An input iterator.</a>
|
|
<a name="1269"><span class="lineNum"> 1269 </span> : : * @param __comp A @link comparison_functors comparison functor@endlink.</a>
|
|
<a name="1270"><span class="lineNum"> 1270 </span> : : * @return A boolean true or false.</a>
|
|
<a name="1271"><span class="lineNum"> 1271 </span> : : *</a>
|
|
<a name="1272"><span class="lineNum"> 1272 </span> : : * The same as the four-parameter @c lexicographical_compare, but uses the</a>
|
|
<a name="1273"><span class="lineNum"> 1273 </span> : : * comp parameter instead of @c <.</a>
|
|
<a name="1274"><span class="lineNum"> 1274 </span> : : */</a>
|
|
<a name="1275"><span class="lineNum"> 1275 </span> : : template<typename _II1, typename _II2, typename _Compare></a>
|
|
<a name="1276"><span class="lineNum"> 1276 </span> : : inline bool</a>
|
|
<a name="1277"><span class="lineNum"> 1277 </span> : : lexicographical_compare(_II1 __first1, _II1 __last1,</a>
|
|
<a name="1278"><span class="lineNum"> 1278 </span> : : _II2 __first2, _II2 __last2, _Compare __comp)</a>
|
|
<a name="1279"><span class="lineNum"> 1279 </span> : : {</a>
|
|
<a name="1280"><span class="lineNum"> 1280 </span> : : // concept requirements</a>
|
|
<a name="1281"><span class="lineNum"> 1281 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_II1>)</a>
|
|
<a name="1282"><span class="lineNum"> 1282 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_II2>)</a>
|
|
<a name="1283"><span class="lineNum"> 1283 </span> : : __glibcxx_requires_valid_range(__first1, __last1);</a>
|
|
<a name="1284"><span class="lineNum"> 1284 </span> : : __glibcxx_requires_valid_range(__first2, __last2);</a>
|
|
<a name="1285"><span class="lineNum"> 1285 </span> : : </a>
|
|
<a name="1286"><span class="lineNum"> 1286 </span> : : return std::__lexicographical_compare_impl</a>
|
|
<a name="1287"><span class="lineNum"> 1287 </span> : : (__first1, __last1, __first2, __last2,</a>
|
|
<a name="1288"><span class="lineNum"> 1288 </span> : : __gnu_cxx::__ops::__iter_comp_iter(__comp));</a>
|
|
<a name="1289"><span class="lineNum"> 1289 </span> : : }</a>
|
|
<a name="1290"><span class="lineNum"> 1290 </span> : : </a>
|
|
<a name="1291"><span class="lineNum"> 1291 </span> : : template<typename _InputIterator1, typename _InputIterator2,</a>
|
|
<a name="1292"><span class="lineNum"> 1292 </span> : : typename _BinaryPredicate></a>
|
|
<a name="1293"><span class="lineNum"> 1293 </span> : : pair<_InputIterator1, _InputIterator2></a>
|
|
<a name="1294"><span class="lineNum"> 1294 </span> : : __mismatch(_InputIterator1 __first1, _InputIterator1 __last1,</a>
|
|
<a name="1295"><span class="lineNum"> 1295 </span> : : _InputIterator2 __first2, _BinaryPredicate __binary_pred)</a>
|
|
<a name="1296"><span class="lineNum"> 1296 </span> : : {</a>
|
|
<a name="1297"><span class="lineNum"> 1297 </span> : : while (__first1 != __last1 && __binary_pred(__first1, __first2))</a>
|
|
<a name="1298"><span class="lineNum"> 1298 </span> : : {</a>
|
|
<a name="1299"><span class="lineNum"> 1299 </span> : : ++__first1;</a>
|
|
<a name="1300"><span class="lineNum"> 1300 </span> : : ++__first2;</a>
|
|
<a name="1301"><span class="lineNum"> 1301 </span> : : }</a>
|
|
<a name="1302"><span class="lineNum"> 1302 </span> : : return pair<_InputIterator1, _InputIterator2>(__first1, __first2);</a>
|
|
<a name="1303"><span class="lineNum"> 1303 </span> : : }</a>
|
|
<a name="1304"><span class="lineNum"> 1304 </span> : : </a>
|
|
<a name="1305"><span class="lineNum"> 1305 </span> : : /**</a>
|
|
<a name="1306"><span class="lineNum"> 1306 </span> : : * @brief Finds the places in ranges which don't match.</a>
|
|
<a name="1307"><span class="lineNum"> 1307 </span> : : * @ingroup non_mutating_algorithms</a>
|
|
<a name="1308"><span class="lineNum"> 1308 </span> : : * @param __first1 An input iterator.</a>
|
|
<a name="1309"><span class="lineNum"> 1309 </span> : : * @param __last1 An input iterator.</a>
|
|
<a name="1310"><span class="lineNum"> 1310 </span> : : * @param __first2 An input iterator.</a>
|
|
<a name="1311"><span class="lineNum"> 1311 </span> : : * @return A pair of iterators pointing to the first mismatch.</a>
|
|
<a name="1312"><span class="lineNum"> 1312 </span> : : *</a>
|
|
<a name="1313"><span class="lineNum"> 1313 </span> : : * This compares the elements of two ranges using @c == and returns a pair</a>
|
|
<a name="1314"><span class="lineNum"> 1314 </span> : : * of iterators. The first iterator points into the first range, the</a>
|
|
<a name="1315"><span class="lineNum"> 1315 </span> : : * second iterator points into the second range, and the elements pointed</a>
|
|
<a name="1316"><span class="lineNum"> 1316 </span> : : * to by the iterators are not equal.</a>
|
|
<a name="1317"><span class="lineNum"> 1317 </span> : : */</a>
|
|
<a name="1318"><span class="lineNum"> 1318 </span> : : template<typename _InputIterator1, typename _InputIterator2></a>
|
|
<a name="1319"><span class="lineNum"> 1319 </span> : : inline pair<_InputIterator1, _InputIterator2></a>
|
|
<a name="1320"><span class="lineNum"> 1320 </span> : : mismatch(_InputIterator1 __first1, _InputIterator1 __last1,</a>
|
|
<a name="1321"><span class="lineNum"> 1321 </span> : : _InputIterator2 __first2)</a>
|
|
<a name="1322"><span class="lineNum"> 1322 </span> : : {</a>
|
|
<a name="1323"><span class="lineNum"> 1323 </span> : : // concept requirements</a>
|
|
<a name="1324"><span class="lineNum"> 1324 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)</a>
|
|
<a name="1325"><span class="lineNum"> 1325 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)</a>
|
|
<a name="1326"><span class="lineNum"> 1326 </span> : : __glibcxx_function_requires(_EqualOpConcept<</a>
|
|
<a name="1327"><span class="lineNum"> 1327 </span> : : typename iterator_traits<_InputIterator1>::value_type,</a>
|
|
<a name="1328"><span class="lineNum"> 1328 </span> : : typename iterator_traits<_InputIterator2>::value_type>)</a>
|
|
<a name="1329"><span class="lineNum"> 1329 </span> : : __glibcxx_requires_valid_range(__first1, __last1);</a>
|
|
<a name="1330"><span class="lineNum"> 1330 </span> : : </a>
|
|
<a name="1331"><span class="lineNum"> 1331 </span> : : return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2,</a>
|
|
<a name="1332"><span class="lineNum"> 1332 </span> : : __gnu_cxx::__ops::__iter_equal_to_iter());</a>
|
|
<a name="1333"><span class="lineNum"> 1333 </span> : : }</a>
|
|
<a name="1334"><span class="lineNum"> 1334 </span> : : </a>
|
|
<a name="1335"><span class="lineNum"> 1335 </span> : : /**</a>
|
|
<a name="1336"><span class="lineNum"> 1336 </span> : : * @brief Finds the places in ranges which don't match.</a>
|
|
<a name="1337"><span class="lineNum"> 1337 </span> : : * @ingroup non_mutating_algorithms</a>
|
|
<a name="1338"><span class="lineNum"> 1338 </span> : : * @param __first1 An input iterator.</a>
|
|
<a name="1339"><span class="lineNum"> 1339 </span> : : * @param __last1 An input iterator.</a>
|
|
<a name="1340"><span class="lineNum"> 1340 </span> : : * @param __first2 An input iterator.</a>
|
|
<a name="1341"><span class="lineNum"> 1341 </span> : : * @param __binary_pred A binary predicate @link functors</a>
|
|
<a name="1342"><span class="lineNum"> 1342 </span> : : * functor@endlink.</a>
|
|
<a name="1343"><span class="lineNum"> 1343 </span> : : * @return A pair of iterators pointing to the first mismatch.</a>
|
|
<a name="1344"><span class="lineNum"> 1344 </span> : : *</a>
|
|
<a name="1345"><span class="lineNum"> 1345 </span> : : * This compares the elements of two ranges using the binary_pred</a>
|
|
<a name="1346"><span class="lineNum"> 1346 </span> : : * parameter, and returns a pair</a>
|
|
<a name="1347"><span class="lineNum"> 1347 </span> : : * of iterators. The first iterator points into the first range, the</a>
|
|
<a name="1348"><span class="lineNum"> 1348 </span> : : * second iterator points into the second range, and the elements pointed</a>
|
|
<a name="1349"><span class="lineNum"> 1349 </span> : : * to by the iterators are not equal.</a>
|
|
<a name="1350"><span class="lineNum"> 1350 </span> : : */</a>
|
|
<a name="1351"><span class="lineNum"> 1351 </span> : : template<typename _InputIterator1, typename _InputIterator2,</a>
|
|
<a name="1352"><span class="lineNum"> 1352 </span> : : typename _BinaryPredicate></a>
|
|
<a name="1353"><span class="lineNum"> 1353 </span> : : inline pair<_InputIterator1, _InputIterator2></a>
|
|
<a name="1354"><span class="lineNum"> 1354 </span> : : mismatch(_InputIterator1 __first1, _InputIterator1 __last1,</a>
|
|
<a name="1355"><span class="lineNum"> 1355 </span> : : _InputIterator2 __first2, _BinaryPredicate __binary_pred)</a>
|
|
<a name="1356"><span class="lineNum"> 1356 </span> : : {</a>
|
|
<a name="1357"><span class="lineNum"> 1357 </span> : : // concept requirements</a>
|
|
<a name="1358"><span class="lineNum"> 1358 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)</a>
|
|
<a name="1359"><span class="lineNum"> 1359 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)</a>
|
|
<a name="1360"><span class="lineNum"> 1360 </span> : : __glibcxx_requires_valid_range(__first1, __last1);</a>
|
|
<a name="1361"><span class="lineNum"> 1361 </span> : : </a>
|
|
<a name="1362"><span class="lineNum"> 1362 </span> : : return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2,</a>
|
|
<a name="1363"><span class="lineNum"> 1363 </span> : : __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));</a>
|
|
<a name="1364"><span class="lineNum"> 1364 </span> : : }</a>
|
|
<a name="1365"><span class="lineNum"> 1365 </span> : : </a>
|
|
<a name="1366"><span class="lineNum"> 1366 </span> : : #if __cplusplus > 201103L</a>
|
|
<a name="1367"><span class="lineNum"> 1367 </span> : : </a>
|
|
<a name="1368"><span class="lineNum"> 1368 </span> : : template<typename _InputIterator1, typename _InputIterator2,</a>
|
|
<a name="1369"><span class="lineNum"> 1369 </span> : : typename _BinaryPredicate></a>
|
|
<a name="1370"><span class="lineNum"> 1370 </span> : : pair<_InputIterator1, _InputIterator2></a>
|
|
<a name="1371"><span class="lineNum"> 1371 </span> : : __mismatch(_InputIterator1 __first1, _InputIterator1 __last1,</a>
|
|
<a name="1372"><span class="lineNum"> 1372 </span> : : _InputIterator2 __first2, _InputIterator2 __last2,</a>
|
|
<a name="1373"><span class="lineNum"> 1373 </span> : : _BinaryPredicate __binary_pred)</a>
|
|
<a name="1374"><span class="lineNum"> 1374 </span> : : {</a>
|
|
<a name="1375"><span class="lineNum"> 1375 </span> : : while (__first1 != __last1 && __first2 != __last2</a>
|
|
<a name="1376"><span class="lineNum"> 1376 </span> : : && __binary_pred(__first1, __first2))</a>
|
|
<a name="1377"><span class="lineNum"> 1377 </span> : : {</a>
|
|
<a name="1378"><span class="lineNum"> 1378 </span> : : ++__first1;</a>
|
|
<a name="1379"><span class="lineNum"> 1379 </span> : : ++__first2;</a>
|
|
<a name="1380"><span class="lineNum"> 1380 </span> : : }</a>
|
|
<a name="1381"><span class="lineNum"> 1381 </span> : : return pair<_InputIterator1, _InputIterator2>(__first1, __first2);</a>
|
|
<a name="1382"><span class="lineNum"> 1382 </span> : : }</a>
|
|
<a name="1383"><span class="lineNum"> 1383 </span> : : </a>
|
|
<a name="1384"><span class="lineNum"> 1384 </span> : : /**</a>
|
|
<a name="1385"><span class="lineNum"> 1385 </span> : : * @brief Finds the places in ranges which don't match.</a>
|
|
<a name="1386"><span class="lineNum"> 1386 </span> : : * @ingroup non_mutating_algorithms</a>
|
|
<a name="1387"><span class="lineNum"> 1387 </span> : : * @param __first1 An input iterator.</a>
|
|
<a name="1388"><span class="lineNum"> 1388 </span> : : * @param __last1 An input iterator.</a>
|
|
<a name="1389"><span class="lineNum"> 1389 </span> : : * @param __first2 An input iterator.</a>
|
|
<a name="1390"><span class="lineNum"> 1390 </span> : : * @param __last2 An input iterator.</a>
|
|
<a name="1391"><span class="lineNum"> 1391 </span> : : * @return A pair of iterators pointing to the first mismatch.</a>
|
|
<a name="1392"><span class="lineNum"> 1392 </span> : : *</a>
|
|
<a name="1393"><span class="lineNum"> 1393 </span> : : * This compares the elements of two ranges using @c == and returns a pair</a>
|
|
<a name="1394"><span class="lineNum"> 1394 </span> : : * of iterators. The first iterator points into the first range, the</a>
|
|
<a name="1395"><span class="lineNum"> 1395 </span> : : * second iterator points into the second range, and the elements pointed</a>
|
|
<a name="1396"><span class="lineNum"> 1396 </span> : : * to by the iterators are not equal.</a>
|
|
<a name="1397"><span class="lineNum"> 1397 </span> : : */</a>
|
|
<a name="1398"><span class="lineNum"> 1398 </span> : : template<typename _InputIterator1, typename _InputIterator2></a>
|
|
<a name="1399"><span class="lineNum"> 1399 </span> : : inline pair<_InputIterator1, _InputIterator2></a>
|
|
<a name="1400"><span class="lineNum"> 1400 </span> : : mismatch(_InputIterator1 __first1, _InputIterator1 __last1,</a>
|
|
<a name="1401"><span class="lineNum"> 1401 </span> : : _InputIterator2 __first2, _InputIterator2 __last2)</a>
|
|
<a name="1402"><span class="lineNum"> 1402 </span> : : {</a>
|
|
<a name="1403"><span class="lineNum"> 1403 </span> : : // concept requirements</a>
|
|
<a name="1404"><span class="lineNum"> 1404 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)</a>
|
|
<a name="1405"><span class="lineNum"> 1405 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)</a>
|
|
<a name="1406"><span class="lineNum"> 1406 </span> : : __glibcxx_function_requires(_EqualOpConcept<</a>
|
|
<a name="1407"><span class="lineNum"> 1407 </span> : : typename iterator_traits<_InputIterator1>::value_type,</a>
|
|
<a name="1408"><span class="lineNum"> 1408 </span> : : typename iterator_traits<_InputIterator2>::value_type>)</a>
|
|
<a name="1409"><span class="lineNum"> 1409 </span> : : __glibcxx_requires_valid_range(__first1, __last1);</a>
|
|
<a name="1410"><span class="lineNum"> 1410 </span> : : __glibcxx_requires_valid_range(__first2, __last2);</a>
|
|
<a name="1411"><span class="lineNum"> 1411 </span> : : </a>
|
|
<a name="1412"><span class="lineNum"> 1412 </span> : : return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2, __last2,</a>
|
|
<a name="1413"><span class="lineNum"> 1413 </span> : : __gnu_cxx::__ops::__iter_equal_to_iter());</a>
|
|
<a name="1414"><span class="lineNum"> 1414 </span> : : }</a>
|
|
<a name="1415"><span class="lineNum"> 1415 </span> : : </a>
|
|
<a name="1416"><span class="lineNum"> 1416 </span> : : /**</a>
|
|
<a name="1417"><span class="lineNum"> 1417 </span> : : * @brief Finds the places in ranges which don't match.</a>
|
|
<a name="1418"><span class="lineNum"> 1418 </span> : : * @ingroup non_mutating_algorithms</a>
|
|
<a name="1419"><span class="lineNum"> 1419 </span> : : * @param __first1 An input iterator.</a>
|
|
<a name="1420"><span class="lineNum"> 1420 </span> : : * @param __last1 An input iterator.</a>
|
|
<a name="1421"><span class="lineNum"> 1421 </span> : : * @param __first2 An input iterator.</a>
|
|
<a name="1422"><span class="lineNum"> 1422 </span> : : * @param __last2 An input iterator.</a>
|
|
<a name="1423"><span class="lineNum"> 1423 </span> : : * @param __binary_pred A binary predicate @link functors</a>
|
|
<a name="1424"><span class="lineNum"> 1424 </span> : : * functor@endlink.</a>
|
|
<a name="1425"><span class="lineNum"> 1425 </span> : : * @return A pair of iterators pointing to the first mismatch.</a>
|
|
<a name="1426"><span class="lineNum"> 1426 </span> : : *</a>
|
|
<a name="1427"><span class="lineNum"> 1427 </span> : : * This compares the elements of two ranges using the binary_pred</a>
|
|
<a name="1428"><span class="lineNum"> 1428 </span> : : * parameter, and returns a pair</a>
|
|
<a name="1429"><span class="lineNum"> 1429 </span> : : * of iterators. The first iterator points into the first range, the</a>
|
|
<a name="1430"><span class="lineNum"> 1430 </span> : : * second iterator points into the second range, and the elements pointed</a>
|
|
<a name="1431"><span class="lineNum"> 1431 </span> : : * to by the iterators are not equal.</a>
|
|
<a name="1432"><span class="lineNum"> 1432 </span> : : */</a>
|
|
<a name="1433"><span class="lineNum"> 1433 </span> : : template<typename _InputIterator1, typename _InputIterator2,</a>
|
|
<a name="1434"><span class="lineNum"> 1434 </span> : : typename _BinaryPredicate></a>
|
|
<a name="1435"><span class="lineNum"> 1435 </span> : : inline pair<_InputIterator1, _InputIterator2></a>
|
|
<a name="1436"><span class="lineNum"> 1436 </span> : : mismatch(_InputIterator1 __first1, _InputIterator1 __last1,</a>
|
|
<a name="1437"><span class="lineNum"> 1437 </span> : : _InputIterator2 __first2, _InputIterator2 __last2,</a>
|
|
<a name="1438"><span class="lineNum"> 1438 </span> : : _BinaryPredicate __binary_pred)</a>
|
|
<a name="1439"><span class="lineNum"> 1439 </span> : : {</a>
|
|
<a name="1440"><span class="lineNum"> 1440 </span> : : // concept requirements</a>
|
|
<a name="1441"><span class="lineNum"> 1441 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)</a>
|
|
<a name="1442"><span class="lineNum"> 1442 </span> : : __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)</a>
|
|
<a name="1443"><span class="lineNum"> 1443 </span> : : __glibcxx_requires_valid_range(__first1, __last1);</a>
|
|
<a name="1444"><span class="lineNum"> 1444 </span> : : __glibcxx_requires_valid_range(__first2, __last2);</a>
|
|
<a name="1445"><span class="lineNum"> 1445 </span> : : </a>
|
|
<a name="1446"><span class="lineNum"> 1446 </span> : : return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2, __last2,</a>
|
|
<a name="1447"><span class="lineNum"> 1447 </span> : : __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));</a>
|
|
<a name="1448"><span class="lineNum"> 1448 </span> : : }</a>
|
|
<a name="1449"><span class="lineNum"> 1449 </span> : : #endif</a>
|
|
<a name="1450"><span class="lineNum"> 1450 </span> : : </a>
|
|
<a name="1451"><span class="lineNum"> 1451 </span> : : _GLIBCXX_END_NAMESPACE_ALGO</a>
|
|
<a name="1452"><span class="lineNum"> 1452 </span> : : _GLIBCXX_END_NAMESPACE_VERSION</a>
|
|
<a name="1453"><span class="lineNum"> 1453 </span> : : } // namespace std</a>
|
|
<a name="1454"><span class="lineNum"> 1454 </span> : : </a>
|
|
<a name="1455"><span class="lineNum"> 1455 </span> : : // NB: This file is included within many other C++ includes, as a way</a>
|
|
<a name="1456"><span class="lineNum"> 1456 </span> : : // of getting the base algorithms. So, make sure that parallel bits</a>
|
|
<a name="1457"><span class="lineNum"> 1457 </span> : : // come in too if requested.</a>
|
|
<a name="1458"><span class="lineNum"> 1458 </span> : : #ifdef _GLIBCXX_PARALLEL</a>
|
|
<a name="1459"><span class="lineNum"> 1459 </span> : : # include <parallel/algobase.h></a>
|
|
<a name="1460"><span class="lineNum"> 1460 </span> : : #endif</a>
|
|
<a name="1461"><span class="lineNum"> 1461 </span> : : </a>
|
|
<a name="1462"><span class="lineNum"> 1462 </span> : : #endif</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>
|