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

53 lines
3.2 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::shared_lock&lt;Mutex&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_thread_shared_lock_operator 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::shared_lock&lt;Mutex&gt;::</span>operator=</h1>
<div id="bodyContent">
<div id="contentSub"><span class="subpages">&lt; <a href="cpp.html">cpp</a>&lrm; | <a href="cpp-thread.html">thread</a>&lrm; | <a href="cpp-thread-shared_lock.html">shared lock</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-cxx14">
<td>
<div><span class="mw-geshi cpp source-cpp">shared_lock<span class="sy3">&amp;</span> operator<span class="sy1">=</span><span class="br0">(</span> shared_lock<span class="sy3">&amp;&amp;</span> other <span class="br0">)</span> <span class="kw1">noexcept</span><span class="sy4">;</span></span></div>
</td>
<td class="t-dcl-nopad"></td>
<td><span class="t-mark-rev t-since-cxx14">(C++14 &#36215;)</span></td>
</tr>
<tr class="t-dcl-sep">
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&#31227;&#21160;&#36171;&#20540;&#36816;&#31639;&#31526;&#12290;&#29992;&#31227;&#21160;&#35821;&#20041;&#20197; <code>other</code> &#30340;&#20869;&#23481;&#26367;&#25442;&#20869;&#23481;&#12290;</p>
<p>&#33509;&#22312;&#27492;&#35843;&#29992;&#21069; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="sy2">*</span>this</span></span> &#25317;&#26377;&#20851;&#32852;&#30340;&#20114;&#26021;&#65288; <span class="t-lc"><a href="cpp-thread-shared_lock-mutex.html">mutex()</a></span> &#36820;&#22238;&#38750;&#31354;&#25351;&#38024;&#19988;&#65289;&#19988;&#33719;&#24471;&#20102;&#20854;&#25152;&#26377;&#26435;&#65288; <span class="t-lc">owns()</span> &#36820;&#22238; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">true</span></span></span> &#65289;&#65292;&#21017;&#36890;&#36807;&#35843;&#29992; <span class="t-lc"><a href="cpp-thread-shared_mutex-unlock_shared.html">unlock_shared()</a></span> &#35299;&#38145;&#20114;&#26021;&#12290;</p>
<p>&#27492;&#35843;&#29992;&#21518;&#65292; <code>other</code> &#26080;&#20851;&#32852;&#30340;&#20114;&#26021;&#12290;</p>
<p><br /></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>other</td>
<td>-</td>
<td>&#29992;&#20197;&#26367;&#25442;&#29366;&#24577;&#30340;&#21478;&#19968; <code>shared_lock</code></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>
</div>
<div class="visualClear"></div>
</div>
</div>
</div>
</body>
</html>