Files
hustoj/web/cppreference-zh/chmhelp/cpp-ranges-take_while_view-sentinel-operator_cmp.html
2025-08-01 12:57:54 +08:00

67 lines
5.4 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>operator==(ranges::take_while_view::sentinel)</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_ranges_take_while_view_sentinel_operator_cmp skin-cppreference2 action-view cpp-navbar">
<div id="cpp-content-base">
<div id="content"><a id="top"></a>
<h1 id="firstHeading" class="firstHeading">operator==<small>(ranges::take_while_view::<i>sentinel</i>)</small></h1>
<div id="bodyContent">
<div id="contentSub"><span class="subpages">&lt; <a href="cpp.html">cpp</a>&lrm; | <a href="cpp-ranges.html">ranges</a>&lrm; | <a href="cpp-ranges-take_while_view.html">take while view</a>&lrm; | <a href="cpp-ranges-take_while_view-sentinel.html">sentinel</a></span></div>
<div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr" xml:lang="zh">
<table class="t-dcl-begin">
<tbody>
<tr class="t-dcl t-since-cxx20">
<td>
<div><span class="mw-geshi cpp source-cpp"><span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span> <span class="kw4">const</span> ranges<span class="sy4">::</span><span class="me2">iterator_t</span><span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy3">&amp;</span> x,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">const</span> <span class="coMULTI">/*sentinel*/</span><span class="sy3">&amp;</span> y<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-cxx20">(C++20 &#36215;)</span></td>
</tr>
<tr class="t-dcl-sep">
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&#27604;&#36739; <span class="t-c"><span class="mw-geshi cpp source-cpp">take_while_view<span class="sy4">::</span><span class="coMULTI">/*sentinel*/</span></span></span> &#19982;&#25351;&#21521;&#65288;&#21487;&#33021;&#20026; const &#38480;&#23450;&#30340;&#65289;&#35270;&#22270; <code>V</code> &#20013;&#30340;&#36845;&#20195;&#22120;&#12290;&#36845;&#20195;&#22120;&#24120;&#20174;&#35843;&#29992; <a href="cpp-ranges-take_while_view-begin.html"><tt>take_while_view::begin</tt></a> &#33719;&#24471;&#12290;</p>
<p>&#33509; <code>x</code> &#19982; <code>y</code> &#30340;&#24213;&#23618;&#21736;&#20301;&#65288;&#21363; <a href="cpp-ranges-take_while_view-sentinel-base.html"><code>y.base()</code></a> &#65289;&#27604;&#36739;&#30456;&#31561;&#25110;&#35859;&#35789;&#22312;&#24212;&#29992;&#21040; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="sy2">*</span>x</span></span> &#26102;&#36820;&#22238; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">false</span></span></span> &#21017;&#36820;&#22238; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">true</span></span></span> &#12290;</p>
<p>&#27492;&#20989;&#25968;&#23545;&#36890;&#24120;<a href="cpp-language-unqualified_lookup.html">&#26080;&#38480;&#23450;</a>&#25110;<a href="cpp-language-qualified_lookup.html">&#26377;&#38480;&#23450;&#26597;&#25214;</a>&#19981;&#21487;&#35265;&#65292;&#32780;&#21482;&#33021;&#22312; <code>take_while_view::<i>sentinel</i>&lt;Const&gt;</code> &#20026;&#21442;&#25968;&#30340;&#20851;&#32852;&#31867;&#26102;&#30001;<a href="cpp-language-adl.html">&#23454;&#21442;&#20381;&#36182;&#26597;&#25214;</a>&#25214;&#21040;&#12290;</p>
<p><code>!=</code> &#36816;&#31639;&#31526;&#20174; <code>operator==</code> <a href="cpp-language-operators.html#.E5.85.B3.E7.B3.BB.E8.BF.90.E7.AE.97.E7.AC.A6">&#21512;&#25104;</a>&#12290;</p>
<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>x</td>
<td>-</td>
<td>&#35201;&#27604;&#36739;&#30340;&#36845;&#20195;&#22120;</td>
</tr>
<tr class="t-par">
<td>y</td>
<td>-</td>
<td>&#35201;&#27604;&#36739;&#30340;&#21736;&#20301;</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">y.<span class="me1">end_</span> <span class="sy1">==</span> x <span class="sy3">||</span> <span class="sy3">!</span><a href="cpp-utility-functional-invoke.html"><span class="kw1058">std::<span class="me2">invoke</span></span></a><span class="br0">(</span><span class="sy2">*</span>y.<span class="me1">pred_</span>, <span class="sy2">*</span>x<span class="br0">)</span></span></span> &#65292;&#20854;&#20013; <code><i>end_</i></code> &#20195;&#34920;&#23384;&#20648;&#30340;&#21736;&#20301;&#32780; <code><i>pred_</i></code> &#20195;&#34920;&#23384;&#20648;&#30340;&#25351;&#21521;&#35859;&#35789;&#30340;&#25351;&#38024;&#12290;</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>
</div>
<div class="visualClear"></div>
</div>
</div>
</div>
</body>
</html>