上传cppreference
This commit is contained in:
84
web/cppreference-zh/chmhelp/cpp-memory-shared_ptr-swap2.html
Normal file
84
web/cppreference-zh/chmhelp/cpp-memory-shared_ptr-swap2.html
Normal file
@@ -0,0 +1,84 @@
|
||||
<!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::swap(std::shared_ptr)</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_memory_shared_ptr_swap2 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::</span>swap<small>(std::shared_ptr)</small></h1>
|
||||
<div id="bodyContent">
|
||||
<div id="contentSub"><span class="subpages">< <a href="cpp.html">cpp</a>‎ | <a href="cpp-memory.html">memory</a>‎ | <a href="cpp-memory-shared_ptr.html">shared ptr</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>
|
||||
<tr class="t-dsc-header">
|
||||
<td>
|
||||
<div>定义于头文件 <code><a href="cpp-header-memory.html"><memory></a></code></div>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="t-dcl t-since-cxx11">
|
||||
<td>
|
||||
<div><span class="mw-geshi cpp source-cpp"><span class="kw1">template</span><span class="sy1"><</span> <span class="kw1">class</span> T <span class="sy1">></span><br />
|
||||
<span class="kw4">void</span> swap<span class="br0">(</span> <a href="cpp-memory-shared_ptr.html"><span class="kw734">std::<span class="me2">shared_ptr</span></span></a><span class="sy1"><</span>T<span class="sy1">></span><span class="sy3">&</span> lhs, <a href="cpp-memory-shared_ptr.html"><span class="kw734">std::<span class="me2">shared_ptr</span></span></a><span class="sy1"><</span>T<span class="sy1">></span><span class="sy3">&</span> rhs <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-cxx11">(C++11 起)</span></td>
|
||||
</tr>
|
||||
<tr class="t-dcl-sep">
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>对 <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="cpp-memory-shared_ptr.html"><span class="kw734">std::<span class="me2">shared_ptr</span></span></a></span></span> 特化 <span class="t-lc"><a href="cpp-algorithm-swap.html">std::swap</a></span> 算法。交换 <code>lhs</code> 与 <code>rhs</code> 的内容。调用 <span class="t-c"><span class="mw-geshi cpp source-cpp">lhs.<span class="me1">swap</span><span class="br0">(</span>rhs<span class="br0">)</span></span></span> 。</p>
|
||||
<p><br /></p>
|
||||
<h3><span class="mw-headline" id=".E5.8F.82.E6.95.B0">参数</span></h3>
|
||||
<table class="t-par-begin">
|
||||
<tr class="t-par">
|
||||
<td>lhs, rhs</td>
|
||||
<td>-</td>
|
||||
<td>要交换内容的智能指针</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3><span class="mw-headline" id=".E8.BF.94.E5.9B.9E.E5.80.BC">返回值</span></h3>
|
||||
<p>(无)</p>
|
||||
<h3><span class="mw-headline" id=".E5.A4.8D.E6.9D.82.E5.BA.A6">复杂度</span></h3>
|
||||
<p>常数</p>
|
||||
<h3><span class="mw-headline" id=".E5.8F.82.E9.98.85">参阅</span></h3>
|
||||
<table class="t-dsc-begin">
|
||||
<tr class="t-dsc">
|
||||
<td>
|
||||
<div class="t-dsc-member-div">
|
||||
<div><a href="cpp-algorithm-swap.html"><span class="t-lines"><span>swap</span></span></a></div>
|
||||
</div>
|
||||
</td>
|
||||
<td>交换两个对象的值<br />
|
||||
<span class="t-mark">(函数模板)</span></td>
|
||||
</tr>
|
||||
<tr class="t-dsc">
|
||||
<td>
|
||||
<div class="t-dsc-member-div">
|
||||
<div><a href="cpp-memory-shared_ptr-swap.html"><span class="t-lines"><span>swap</span></span></a></div>
|
||||
</div>
|
||||
</td>
|
||||
<td>交换内容<br />
|
||||
<span class="t-mark">(公开成员函数)</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="visualClear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user