Skip to content

Commit

Permalink
[faq] typo: 添加代码行号
Browse files Browse the repository at this point in the history
  • Loading branch information
FeignClaims authored Feb 1, 2024
1 parent fc9e27b commit 408066c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/faq/copy_assignment_define/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ copy-and-swap: 拷贝赋值函数的简单实现
如果有定义的需求, 且拷贝仅仅是拷贝, 不是因为题目而有输出之类的特殊要求, 则可以先定义拷贝构造函数、析构函数, 然后利用它们定义拷贝赋值函数, 这称为 copy-and-swap 惯用法.

.. code-block:: cpp
:linenos:
Widget& operator=(Widget const& other) {
Widget temp(other); // 拷贝 other 到 temp
Expand Down

0 comments on commit 408066c

Please sign in to comment.