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

52 lines
3.0 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::basic_iostream&lt;CharT,Traits&gt;::swap</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_io_basic_iostream_swap 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::basic_iostream&lt;CharT,Traits&gt;::</span>swap</h1>
<div id="bodyContent">
<div id="contentSub"><span class="subpages">&lt; <a href="cpp.html">cpp</a>&lrm; | <a href="cpp-io.html">io</a>&lrm; | <a href="cpp-io-basic_iostream.html">basic iostream</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-cxx11">
<td>
<div><span class="mw-geshi cpp source-cpp"><span class="kw1">protected</span><span class="sy4">:</span><br />
<span class="kw4">void</span> swap<span class="br0">(</span> basic_iostream<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-cxx11">(C++11 &#36215;)</span></td>
</tr>
<tr class="t-dcl-sep">
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&#19982;&#21478;&#19968;&#36755;&#20837;/&#36755;&#20986;&#27969;&#20132;&#25442;&#29366;&#24577;&#12290;&#31561;&#25928;&#22320;&#35843;&#29992; <span class="t-c"><span class="mw-geshi cpp source-cpp">basic_istream<span class="sy1">&lt;</span>CharT,Traits<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">swap</span><span class="br0">(</span>other<span class="br0">)</span></span></span> &#12290;</p>
<p>&#27492;&#25104;&#21592;&#20989;&#25968;&#21463;&#20445;&#25252;&#65306;&#23548;&#20986;&#27969;&#31867; <span class="t-lc"><a href="cpp-io-basic_stringstream.html">std::basic_stringstream</a></span> &#21644; <span class="t-lc"><a href="cpp-io-basic_fstream.html">std::basic_fstream</a></span> &#30340; swap &#25104;&#21592;&#20989;&#25968;&#30693;&#26195;&#22914;&#20309;&#27491;&#30830;&#20132;&#25442;&#20851;&#32852;&#32531;&#20914;&#21306;&#65292;&#24182;&#35843;&#29992;&#27492;&#20989;&#25968;&#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>other</td>
<td>-</td>
<td>&#35201;&#20132;&#25442;&#29366;&#24577;&#30340;&#21478;&#19968;&#27969;</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>