Skip to content

Commit

Permalink
feat: 添加移动语义到基本概念
Browse files Browse the repository at this point in the history
  • Loading branch information
FeignClaims committed Oct 8, 2024
1 parent a0a5ea7 commit 71d5e32
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions faq/basic_concepts/move_semantics.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
************************************************************************************************************************
移动语义 (move semantics)
************************************************************************************************************************

这个概念的解释必须结合不少内容, 请通读 :doc:`/faq/rule_of_350/main` 以学习这个概念.
5 changes: 5 additions & 0 deletions faq/dynamic_array/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,11 @@
扩展: 让动态数组支持高效的移动
========================================================================================================================

.. admonition:: 前置内容
:class: precontent

- :doc:`/faq/basic_concepts/move_semantics`

定义拷贝函数后, 我们不再能高效地返回动态数组:

.. code-block:: cpp
Expand Down
5 changes: 5 additions & 0 deletions faq/forward_list/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,11 @@
.. admonition:: 别看: 让链表支持高效的移动
:class: dropdown, dontread

.. admonition:: 前置内容
:class: precontent

- :doc:`/faq/basic_concepts/move_semantics`

这样定义拷贝函数后, 我们不再能高效地返回本地对象:

.. code-block:: cpp
Expand Down

0 comments on commit 71d5e32

Please sign in to comment.