C++移动中涉及的术语

Terminology involved in C++ move

本文关键字:术语 移动 C++      更新时间:2023-10-16

在此页面上 http://herbsutter.com/elements-of-modern-c-style/"移动/&&"部分中,它指的是以下上下文中被调用方分配的术语(引用自该链接):

// C++11: move
vector<int> make_big_vector(); // usually sufficient for 'callee-allocated out' situations
:::
auto result = make_big_vector(); // guaranteed not to copy the vector

这个词是什么意思?

"Callee-allocationized",如被调用的函数分配,"out"表示返回数据。 这与"调用方分配"相反,在"调用方分配"中,调用方必须将分配的结构传递到函数中。