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

102 lines
5.6 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::locale::operator==, 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_locale_locale_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"><span style="font-size:0.7em; line-height:130%">std::locale::</span>operator==, operator!=</h1>
<div id="bodyContent">
<div id="contentSub"><span class="subpages">&lt; <a href="cpp.html">cpp</a>&lrm; | <a href="cpp-locale.html">locale</a>&lrm; | <a href="cpp-locale-locale.html">locale</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-dsc-header">
<td>
<div>&#23450;&#20041;&#20110;&#22836;&#25991;&#20214; <code><a href="cpp-header-locale.html">&lt;locale&gt;</a></code></div>
</td>
<td></td>
<td></td>
</tr>
<tr class="t-dcl">
<td>
<div><span class="mw-geshi cpp source-cpp"><span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span> <span class="kw4">const</span> locale<span class="sy3">&amp;</span> other <span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span></span></div>
</td>
<td>(1)</td>
<td class="t-dcl-nopad"></td>
</tr>
<tr class="t-dcl t-until-cxx20">
<td>
<div><span class="mw-geshi cpp source-cpp"><span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span> <span class="kw4">const</span> locale<span class="sy3">&amp;</span> other <span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span></span></div>
</td>
<td>(2)</td>
<td><span class="t-mark-rev t-until-cxx20">(C++20 &#21069;)</span></td>
</tr>
<tr class="t-dcl-sep">
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&#27979;&#35797;&#20108;&#20010;&#26412;&#22320;&#29615;&#22659;&#30340;&#30456;&#31561;&#24615;&#12290;&#33509;&#20855;&#21517; locale &#30340;&#21517;&#31216;&#30456;&#31561;&#21017;&#35748;&#20026;&#23427;&#20204;&#30456;&#31561;&#12290;&#33509;&#26080;&#21517; locale &#20114;&#20026;&#24444;&#27492;&#30340;&#21103;&#26412;&#21017;&#35748;&#20026;&#23427;&#20204;&#30456;&#31561;&#12290;</p>
<table class="t-rev-begin">
<tr class="t-rev t-since-cxx20">
<td>
<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>
</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;&#27604;&#36739;&#30340; <span class="t-lc"><a href="cpp-locale-locale.html">std::locale</a></span> &#23545;&#35937;</td>
</tr>
</table>
<h3><span class="mw-headline" id=".E8.BF.94.E5.9B.9E.E5.80.BC">&#36820;&#22238;&#20540;</span></h3>
<div class="t-li1"><span class="t-li">1)</span> &#33509; <code>other</code> &#20026; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="sy2">*</span>this</span></span> &#30340;&#21103;&#26412;&#25110;&#25317;&#26377;&#31561;&#21516;&#21517;&#31216;&#21017;&#20026; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">true</span></span></span> &#65292;&#21542;&#21017;&#20026; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">false</span></span></span> &#12290;</div>
<div class="t-li1"><span class="t-li">2)</span> &#33509; <code>other</code> &#20026; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="sy2">*</span>this</span></span> &#30340;&#21103;&#26412;&#25110;&#25317;&#26377;&#31561;&#21516;&#21517;&#31216;&#21017;&#20026; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">false</span></span></span> &#65292;&#21542;&#21017;&#20026; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">true</span></span></span> &#12290;</div>
<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=".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-locale-locale-locale.html"><span class="t-lines"><span>(&#26500;&#36896;&#20989;&#25968;)</span></span></a></div>
</div>
</td>
<td>&#26500;&#36896;&#26032;&#30340; locale<br />
<span class="t-mark">(&#20844;&#24320;&#25104;&#21592;&#20989;&#25968;)</span></td>
</tr>
<tr class="t-dsc">
<td>
<div class="t-dsc-member-div">
<div><a href="cpp-locale-locale-name.html"><span class="t-lines"><span>name</span></span></a></div>
</div>
</td>
<td>&#36820;&#22238; locale &#30340;&#21517;&#31216;&#65292;&#25110;&#33509;&#23427;&#26080;&#21517;&#21017;&#20026; &quot;*&quot;<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>