Skip to content

Commit

Permalink
deploy: a9f64e9
Browse files Browse the repository at this point in the history
  • Loading branch information
y1yang0 committed Jan 2, 2024
1 parent 61b5a8c commit 52fd161
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 7.TheConcurrencyAPI/item38.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ <h2 id="条款三十八关注不同线程句柄的析构行为"><a class="header
<p><code>std::packaged_task</code>不可拷贝,所以当<code>pt</code>被传递给<code>std::thread</code>构造函数时,必须先转为右值(通过<code>std::move</code>,参见<a href="../5.RRefMovSemPerfForw/item23.html">Item23</a>):</p>
<pre><code class="language-cpp">std::thread t(std::move(pt)); //在t上运行pt
</code></pre>
<p>这个例子是你对于<em>future</em>的析构函数的正常行为有一些了解,但是将这些语句放在一个作用域的语句块里更容易看</p>
<p>这个例子使你对于<em>future</em>的析构函数的正常行为有一些了解,但是将这些语句放在一个作用域的语句块里会使其更易于阅读</p>
<pre><code class="language-cpp">{ //开始代码块
std::packaged_task&lt;int()&gt;
pt(calcValue);
Expand Down
2 changes: 1 addition & 1 deletion print.html
Original file line number Diff line number Diff line change
Expand Up @@ -5389,7 +5389,7 @@ <h2 id="条款三十五优先考虑基于任务的编程而非基于线程的编
<p><code>std::packaged_task</code>不可拷贝,所以当<code>pt</code>被传递给<code>std::thread</code>构造函数时,必须先转为右值(通过<code>std::move</code>,参见<a href="7.TheConcurrencyAPI/../5.RRefMovSemPerfForw/item23.html">Item23</a>):</p>
<pre><code class="language-cpp">std::thread t(std::move(pt)); //在t上运行pt
</code></pre>
<p>这个例子是你对于<em>future</em>的析构函数的正常行为有一些了解,但是将这些语句放在一个作用域的语句块里更容易看:</p>
<p>这个例子使你对于<em>future</em>的析构函数的正常行为有一些了解,但是将这些语句放在一个作用域的语句块里会使其更易于阅读:</p>
<pre><code class="language-cpp">{ //开始代码块
std::packaged_task&lt;int()&gt;
pt(calcValue);
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.json

Large diffs are not rendered by default.

0 comments on commit 52fd161

Please sign in to comment.