mirror of
https://github.com/CnTransGroup/EffectiveModernCppChinese.git
synced 2025-01-28 04:40:30 +08:00
Update item26.md
This commit is contained in:
parent
a5177d63b3
commit
6f9d5cf406
@ -187,12 +187,12 @@ public:
|
|||||||
```cpp
|
```cpp
|
||||||
class SpecialPerson: public Person {
|
class SpecialPerson: public Person {
|
||||||
public:
|
public:
|
||||||
SpecialPerson(const SpecialPerson& rhs) //拷贝构造函数,
|
SpecialPerson(const SpecialPerson& rhs) //拷贝构造函数,调用基类的
|
||||||
: Person(rhs) //调用基类的转发构造函数!
|
: Person(rhs) //完美转发构造函数!
|
||||||
{ … }
|
{ … }
|
||||||
|
|
||||||
SpecialPerson(SpecialPerson&& rhs) //移动构造函数,
|
SpecialPerson(SpecialPerson&& rhs) //移动构造函数,调用基类的
|
||||||
: Person(std::move(rhs)) //调用基类的转发构造函数!
|
: Person(std::move(rhs)) //完美转发构造函数!
|
||||||
{ … }
|
{ … }
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user