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

72 lines
5.5 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>C++ &#20855;&#21517;&#35201;&#27714;&#65306;&#21487;&#31227;&#21160;&#26500;&#36896; (MoveConstructible) (C++11 &#36215;)</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_named_req_MoveConstructible 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%">C++ &#20855;&#21517;&#35201;&#27714;&#65306;</span><span style="font-style:italic">&#21487;&#31227;&#21160;&#26500;&#36896;</span> <span style="font-family: Georgia, &#39;DejaVu Serif&#39;, serif; font-style:italic">(MoveConstructible)</span> <span class="t-mark-rev t-since-cxx11">(C++11 &#36215;)</span></h1>
<div id="bodyContent">
<div id="contentSub"><span class="subpages">&lt; <a href="cpp.html">cpp</a>&lrm; | <a href="cpp-named_req.html">named req</a></span></div>
<div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr" xml:lang="zh">
<p>&#25351;&#23450;&#35813;&#31867;&#22411;&#30340;&#23454;&#20363;&#21487;&#20197;&#20174;&#19968;&#20010;<a href="cpp-language-value_category.html">&#21491;&#20540;</a>&#23454;&#21442;&#26500;&#36896;&#12290;</p>
<h3><span class="mw-headline" id=".E8.A6.81.E6.B1.82">&#35201;&#27714;</span></h3>
<p>&#20197;&#19979;&#24773;&#20917;&#19979;&#65292;&#31867;&#22411; <code>T</code> &#28385;&#36275;<span style="font-style:italic">&#21487;&#31227;&#21160;&#26500;&#36896;</span> <span style="font-family: Georgia, &#39;DejaVu Serif&#39;, serif; font-style:italic">(MoveConstructible)</span> &#65306;</p>
<p>&#32473;&#23450;</p>
<ul>
<li><code>T</code> &#31867;&#22411;&#30340;<a href="cpp-language-value_category.html">&#21491;&#20540;&#34920;&#36798;&#24335;</a> <code>rv</code></li>
<li>&#20219;&#24847;&#26631;&#35782;&#31526; <code>u</code></li>
</ul>
<p>&#19979;&#21015;&#34920;&#36798;&#24335;&#24517;&#39035;&#21512;&#27861;&#19988;&#25317;&#26377;&#20854;&#25351;&#23450;&#30340;&#25928;&#26524;</p>
<table class="wikitable">
<tr>
<th>&#34920;&#36798;&#24335;</th>
<th>&#21518;&#26465;&#20214;</th>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">T u <span class="sy1">=</span> rv<span class="sy4">;</span></span></span></td>
<td><code>u</code> &#30340;&#20540;&#31561;&#20110; <code>rv</code> &#22312;&#21021;&#22987;&#21270;&#21069;&#30340;&#20540;&#12290;<code>rv</code> &#30340;&#26032;&#20540;&#26410;&#25351;&#26126;&#12290;</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">T<span class="br0">(</span>rv<span class="br0">)</span></span></span></td>
<td><code>T(rv)</code> &#30340;&#20540;&#31561;&#20110; <code>rv</code> &#22312;&#21021;&#22987;&#21270;&#21069;&#30340;&#20540;&#12290;<code>rv</code> &#30340;&#26032;&#20540;&#26410;&#25351;&#26126;&#12290;</td>
</tr>
</table>
<h3><span class="mw-headline" id=".E6.B3.A8.E8.A7.A3">&#27880;&#35299;</span></h3>
<p>&#31867;&#19981;&#24517;&#20026;&#28385;&#36275;&#27492;&#35201;&#27714;&#32780;&#23454;&#29616;<a href="cpp-language-move_constructor.html">&#31227;&#21160;&#26500;&#36896;&#20989;&#25968;</a>&#65306;&#25509;&#25910; <code>const T&amp;</code> &#23454;&#21442;&#30340;<a href="cpp-language-copy_constructor.html">&#22797;&#21046;&#26500;&#36896;&#20989;&#25968;</a>&#20063;&#33021;&#32465;&#23450;&#21491;&#20540;&#34920;&#36798;&#24335;&#12290;</p>
<p>&#33509;<span style="font-style:italic">&#21487;&#31227;&#21160;&#26500;&#36896;</span> <span style="font-family: Georgia, &#39;DejaVu Serif&#39;, serif; font-style:italic">(MoveConstructible)</span> &#31867;&#23454;&#29616;&#20102;&#31227;&#21160;&#26500;&#36896;&#20989;&#25968;&#65292;&#21017;&#23427;&#20134;&#21487;&#23454;&#29616;<a href="cpp-utility-move.html">&#31227;&#21160;&#35821;&#20041;</a>&#65292;&#20197;&#20174;&ldquo;&#26500;&#36896;&#21518; <code>rv</code> &#30340;&#20540;&#26410;&#25351;&#26126;&rdquo;&#30340;&#20107;&#23454;&#20013;&#33719;&#21033;&#12290;</p>
<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">
<div><a href="cpp-types-is_move_constructible.html"><span class="t-lines"><span>is_move_constructible</span><span>is_trivially_move_constructible</span><span>is_nothrow_move_constructible</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div>
</td>
<td>&#26816;&#26597;&#31867;&#22411;&#26159;&#21542;&#33021;&#20174;&#21491;&#20540;&#24341;&#29992;&#26500;&#36896;<br />
<span class="t-mark">(&#31867;&#27169;&#26495;)</span></td>
</tr>
<tr class="t-dsc">
<td>
<div class="t-dsc-member-div">
<div><a href="cpp-concepts-move_constructible.html"><span class="t-lines"><span>move_constructible</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div>
</div>
</td>
<td>&#25351;&#23450;&#33021;&#31227;&#21160;&#26500;&#36896;&#19968;&#20010;&#31867;&#22411;&#30340;&#23545;&#35937;<br />
<span class="t-mark">(&#27010;&#24565;)</span></td>
</tr>
</table>
</div>
<div class="visualClear"></div>
</div>
</div>
</div>
</body>
</html>