相关术语
| 中文 | 英文 |
|------|------|
| 移动语义 | move semantics |
| 右值引用 | rvalue reference (T&&) |
| 左值 | lvalue |
| 右值 | rvalue |
| 将亡值 | xvalue (expiring value) |
| 移动构造函数 | move constructor |
| 移动赋值运算符 | move assignment operator |
| 移动迭代器 | move iterator |
| 完美转发 | perfect forwarding |
| 返回值优化 | return value optimization (RVO) |
| 具名返回值优化 | named return value optimization (NRVO) |
例句
-
Move semantics allow resources to be transferred from one object to another instead of copying them.
(移动语义允许把资源从一个对象转移到另一个对象,而不是复制。)
-
Move semantics is one of the most important features introduced in C++11.
(移动语义是 C++11 引入的最重要的特性之一。)
-
The compiler uses move semantics when an object is passed by rvalue reference.
(当对象通过右值引用传递时,编译器会使用移动语义。)
用法说明
-
通常用复数形式 move semantics(把"语义"视为一组规则/机制)。
-
单数 move semantic 较少用,一般不这么写。
-
作定语时:move semantics rules (移动语义规则)、move semantics optimization(移动语义优化)。
移动语义 = move semantics。这是唯一标准、通用的说法。