差别
这里会显示出您选择的修订版和当前版本之间的差别。
| 两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
| public:it:cplusplus:effective_modern_cplusplus [2024/11/06 14:51] – [章节5. 右值引用、移动语义和完美转发] oakfire | public:it:cplusplus:effective_modern_cplusplus [2024/11/06 15:51] (当前版本) – [章节5. 右值引用、移动语义和完美转发] oakfire | ||
|---|---|---|---|
| 行 269: | 行 269: | ||
| short index; | short index; | ||
| logAndAdd(index); | logAndAdd(index); | ||
| - | </ | + | </ |
| + | * 完美转发构造函数尤其如此,因为对于非const左值来说,它们通常比复制构造函数(复制构造函数参数声明为const)更匹配,而且它们可以劫持派生子类调用基类的复制与移动构造函数,转而让子类调用完美转发构造函数。 | ||
| + | === » 条目27 熟悉「重载通值引用」之外的替代方法 === | ||
| ==== 翻译对照 ==== | ==== 翻译对照 ==== | ||
| <WRAP tablewidth 50% > | <WRAP tablewidth 50% > | ||