move assignment(移动赋值):在 C++ 等语言语境中,指用“移动语义”把一个对象的资源(如堆内存、文件句柄等)转移给另一个已存在对象的赋值操作,通常对应 T& operator=(T&&)。这样可避免深拷贝,提高性能。常见于支持 RAII 的类型(如容器、智能指针、字符串类等)。
(在更一般的英语里也可直译为“移动 + 赋值”,但最常见用法来自 C++。)
/muːv əˈsaɪnmənt/
The class supports move assignment.
这个类支持移动赋值。
After adding a move assignment operator, the container can transfer ownership of its buffer without copying, which reduces overhead in large-scale data processing.
添加移动赋值运算符后,容器可以在不拷贝的情况下转移其缓冲区的所有权,从而降低大规模数据处理中的开销。
该短语由 move(移动、转移)和 assignment(赋值)组合而来。在 C++11 引入“移动语义(move semantics)”之后,“move assignment”成为固定术语,用来区分传统的 copy assignment(拷贝赋值):前者强调资源“转移”,后者强调内容“复制”。