Skip to content

Commit

Permalink
[faq] 明确指出基本概念里的交叉内容
Browse files Browse the repository at this point in the history
  • Loading branch information
FeignClaims committed Feb 1, 2024
1 parent 6c75ff2 commit 3cefea5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 11 deletions.
10 changes: 7 additions & 3 deletions docs/faq/basic_concepts/const.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@
读者看到 const 对象时, 必然假设该对象不会被修改;如果人为打破这种约定, 只会让代码难以阅读, 增加维护成本.

========================================================================================================================
:cpp:`const` 与引用
交叉内容
========================================================================================================================

------------------------------------------------------------------------------------------------------------------------
:cpp:`const` 与引用
------------------------------------------------------------------------------------------------------------------------

.. include:: cross/const-reference.irst

========================================================================================================================
------------------------------------------------------------------------------------------------------------------------
:cpp:`const` 与指针
========================================================================================================================
------------------------------------------------------------------------------------------------------------------------

.. include:: cross/const-pointer.irst

Expand Down
6 changes: 5 additions & 1 deletion docs/faq/basic_concepts/function.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,13 @@
- :cpp:`int available_tickets()`.

========================================================================================================================
函数指针 (function pointer)
交叉内容
========================================================================================================================

------------------------------------------------------------------------------------------------------------------------
函数指针 (function pointer)
------------------------------------------------------------------------------------------------------------------------

.. include:: cross/function-pointer.irst

========================================================================================================================
Expand Down
10 changes: 7 additions & 3 deletions docs/faq/basic_concepts/pointer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
pointer = &another_value; // pointer 现在存储 &another_value, 于是指向 another_value
========================================================================================================================
指针与 :cpp:`const`
交叉内容
========================================================================================================================

------------------------------------------------------------------------------------------------------------------------
指针与 :cpp:`const`
------------------------------------------------------------------------------------------------------------------------

.. include:: cross/const-pointer.irst

========================================================================================================================
------------------------------------------------------------------------------------------------------------------------
函数指针 (function pointer)
========================================================================================================================
------------------------------------------------------------------------------------------------------------------------

.. include:: cross/function-pointer.irst

Expand Down
10 changes: 7 additions & 3 deletions docs/faq/basic_concepts/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@
ref = 3; // 通过引用访问对象, 使得 value = 3
========================================================================================================================
引用与 :cpp:`const`
交叉内容
========================================================================================================================

------------------------------------------------------------------------------------------------------------------------
引用与 :cpp:`const`
------------------------------------------------------------------------------------------------------------------------

.. include:: cross/const-reference.irst

========================================================================================================================
------------------------------------------------------------------------------------------------------------------------
引用与值类别
========================================================================================================================
------------------------------------------------------------------------------------------------------------------------

.. include:: cross/reference-value_category.irst

Expand Down
6 changes: 5 additions & 1 deletion docs/faq/basic_concepts/value_category.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@
这里的解释是通用解释, 实际表现可能由于编译器、编译器版本、编译选项、标准版本等存在差异.

========================================================================================================================
值类别与引用
交叉内容
========================================================================================================================

------------------------------------------------------------------------------------------------------------------------
值类别与引用
------------------------------------------------------------------------------------------------------------------------

.. include:: cross/reference-value_category.irst

========================================================================================================================
Expand Down

0 comments on commit 3cefea5

Please sign in to comment.