Update item26.md

This commit is contained in:
猫耳堀川雷鼓 2021-02-25 14:29:34 +08:00 committed by GitHub
parent a5177d63b3
commit 6f9d5cf406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -187,12 +187,12 @@ public:
```cpp
class SpecialPerson: public Person {
public:
SpecialPerson(const SpecialPerson& rhs) //拷贝构造函数,
: Person(rhs) //调用基类的转发构造函数!
SpecialPerson(const SpecialPerson& rhs) //拷贝构造函数,调用基类的
: Person(rhs) //完美转发构造函数!
{ … }
SpecialPerson(SpecialPerson&& rhs) //移动构造函数,
: Person(std::move(rhs)) //调用基类的转发构造函数!
SpecialPerson(SpecialPerson&& rhs) //移动构造函数,调用基类的
: Person(std::move(rhs)) //完美转发构造函数!
{ … }
};
```