Files
hustoj/web/cppreference-zh/chmhelp/cpp-iterator-reverse_iterator-operator=.html
2025-08-01 12:57:54 +08:00

109 lines
5.9 KiB
HTML

<!DOCTYPE html>
<html lang="zh" dir="ltr" class="client-nojs" xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh">
<head><meta http-equiv="x-ua-compatible" content="ie=edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>std::reverse_iterator&lt;Iter&gt;::operator=</title>
<link rel="stylesheet" href="ext.css" />
<link rel="stylesheet" href="site_modules.css" />
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_iterator_reverse_iterator_operator skin-cppreference2 action-view cpp-page-template cpp-navbar">
<div id="cpp-content-base">
<div id="content"><a id="top"></a>
<h1 id="firstHeading" class="firstHeading"><span style="font-size:0.7em; line-height:130%">std::reverse_iterator&lt;Iter&gt;::</span>operator=</h1>
<div id="bodyContent">
<div id="contentSub"><span class="subpages">&lt; <a href="cpp.html">cpp</a>&lrm; | <a href="cpp-iterator.html">iterator</a>&lrm; | <a href="cpp-iterator-reverse_iterator.html">reverse iterator</a></span></div>
<div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr" xml:lang="zh">
<div class="t-page-template" style="">
<p></p>
</div>
<table class="t-dcl-begin">
<tbody></tbody>
<tbody class="t-dcl-rev">
<tr class="t-dcl t-until-cxx17">
<td>
<div><span class="mw-geshi cpp source-cpp"><span class="kw1">template</span><span class="sy1">&lt;</span> <span class="kw1">class</span> U <span class="sy1">&gt;</span><br />
reverse_iterator<span class="sy3">&amp;</span> operator<span class="sy1">=</span><span class="br0">(</span> <span class="kw4">const</span> reverse_iterator<span class="sy1">&lt;</span>U<span class="sy1">&gt;</span><span class="sy3">&amp;</span> other <span class="br0">)</span><span class="sy4">;</span></span></div>
</td>
<td class="t-dcl-nopad"></td>
<td><span class="t-mark-rev t-until-cxx17">(C++17 &#21069;)</span></td>
</tr>
<tr class="t-dcl t-since-cxx17">
<td>
<div><span class="mw-geshi cpp source-cpp"><span class="kw1">template</span><span class="sy1">&lt;</span> <span class="kw1">class</span> U <span class="sy1">&gt;</span><br />
<span class="kw4">constexpr</span> reverse_iterator<span class="sy3">&amp;</span> operator<span class="sy1">=</span><span class="br0">(</span> <span class="kw4">const</span> reverse_iterator<span class="sy1">&lt;</span>U<span class="sy1">&gt;</span><span class="sy3">&amp;</span> other <span class="br0">)</span><span class="sy4">;</span></span></div>
</td>
<td class="t-dcl-nopad"></td>
<td><span class="t-mark-rev t-since-cxx17">(C++17 &#36215;)</span></td>
</tr>
</tbody>
<tbody>
<tr class="t-dcl-sep">
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&#23545;&#24213;&#23618;&#36845;&#20195;&#22120;&#36171; <code>other</code> &#30340;&#24213;&#23618;&#36845;&#20195;&#22120;&#30340;&#20540;&#65292;&#21363; <code>other.base()</code> &#12290;</p>
<table class="t-rev-begin">
<tr class="t-rev t-since-cxx20">
<td>
<p>&#27492;&#37325;&#36733;&#20165;&#33509; <code>U</code> &#19982; <code>Iter</code> &#19981;&#26159;&#21516;&#19968;&#31867;&#22411;&#19988; <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">convertible_to</span><span class="sy1">&lt;</span><span class="kw4">const</span> U<span class="sy3">&amp;</span>, Iter<span class="sy1">&gt;</span></span></span> &#19982; <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">assignable_from</span><span class="sy1">&lt;</span>Iter<span class="sy3">&amp;</span>, <span class="kw4">const</span> U<span class="sy3">&amp;</span><span class="sy1">&gt;</span></span></span> &#22343;&#24471;&#21040;&#23454;&#29616;&#25165;&#21442;&#19982;&#37325;&#36733;&#20915;&#35758;&#12290;</p>
</td>
<td><span class="t-mark-rev t-since-cxx20">(C++20 &#36215;)</span></td>
</tr>
</table>
<h3><span class="mw-headline" id=".E5.8F.82.E6.95.B0">&#21442;&#25968;</span></h3>
<table class="t-par-begin">
<tr class="t-par">
<td>other</td>
<td>-</td>
<td>&#35201;&#36171;&#20540;&#30340;&#36845;&#20195;&#22120;&#36866;&#37197;&#22120;</td>
</tr>
</table>
<h3><span class="mw-headline" id=".E8.BF.94.E5.9B.9E.E5.80.BC">&#36820;&#22238;&#20540;</span></h3>
<p><span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="sy2">*</span>this</span></span></p>
<h3><span class="mw-headline" id=".E7.A4.BA.E4.BE.8B">&#31034;&#20363;</span></h3>
<table class="metadata plainlinks ambox mbox-small-left ambox-notice" style="">
<tr>
<td class="mbox-empty-cell"></td>
<td class="mbox-text" style="">&#26412;&#33410;&#26410;&#23436;&#25104;<br />
&#21407;&#22240;&#65306;&#26242;&#26080;&#31034;&#20363;</td>
</tr>
</table>
<h3><span class="mw-headline" id=".E7.BC.BA.E9.99.B7.E6.8A.A5.E5.91.8A">&#32570;&#38519;&#25253;&#21578;</span></h3>
<p>&#19979;&#21015;&#26356;&#25913;&#34892;&#20026;&#30340;&#32570;&#38519;&#25253;&#21578;&#36861;&#28335;&#22320;&#24212;&#29992;&#20110;&#20197;&#21069;&#20986;&#29256;&#30340; C++ &#26631;&#20934;&#12290;</p>
<table class="dsctable" style="font-size:0.8em">
<tr>
<th>DR</th>
<th>&#24212;&#29992;&#20110;</th>
<th>&#20986;&#29256;&#26102;&#30340;&#34892;&#20026;</th>
<th>&#27491;&#30830;&#34892;&#20026;</th>
</tr>
<tr>
<td><a rel="nofollow" class="external text" href="https://cplusplus.github.io/LWG/issue3435">LWG 3435</a></td>
<td>C++20</td>
<td>&#36716;&#25442;&#36171;&#20540;&#36816;&#31639;&#31526;&#26410;&#21463;&#32422;&#26463;</td>
<td>&#24050;&#32422;&#26463;</td>
</tr>
</table>
<h3><span class="mw-headline" id=".E5.8F.82.E9.98.85">&#21442;&#38405;</span></h3>
<table class="t-dsc-begin">
<tr class="t-dsc">
<td>
<div class="t-dsc-member-div t-dsc-member-nobold-div">
<div><a href="cpp-iterator-reverse_iterator-reverse_iterator.html"><span class="t-lines"><span>(&#26500;&#36896;&#20989;&#25968;)</span></span></a></div>
</div>
</td>
<td>&#26500;&#36896;&#26032;&#30340;&#36845;&#20195;&#22120;&#36866;&#37197;&#22120;<br />
<span class="t-mark">(&#20844;&#24320;&#25104;&#21592;&#20989;&#25968;)</span></td>
</tr>
</table>
</div>
<div class="visualClear"></div>
</div>
</div>
</div>
</body>
</html>