Skip to content

Commit

Permalink
[faq] 删除感性解释警告
Browse files Browse the repository at this point in the history
  • Loading branch information
FeignClaims authored Feb 1, 2024
1 parent 51c094d commit f0e20b8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions docs/faq/basic_concepts/cross/reference-value_category.irst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.. warning::

这部分内容很难在新手期给出符合标准的简洁解释, 以下为可以借鉴的感性理解:

:cpp:`T&` 只能引用左值即 "已经存在的对象", 因此不进行会产生临时对象的隐式类型转换.

.. code-block:: cpp
Expand All @@ -25,4 +21,4 @@
:linenos:

double value = 0;
int const& reference = value; // 正确: T const& 能够引用临时对象
int const& reference = value; // 正确: T const& 能够引用临时对象

0 comments on commit f0e20b8

Please sign in to comment.