Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Terminology involved in C++ move

Tags:

c++

move

On this page http://herbsutter.com/elements-of-modern-c-style/ in the "Move / &&" section it refers to the term callee-allocated out in the following context (quoted from that link):

// 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

What does that term mean?

like image 672
user3626676 Avatar asked Dec 31 '25 04:12

user3626676


1 Answers

"Callee-allocated" as in allocated by the function being called, "out" meaning data being returned. This is as opposed to "caller-allocated" where the caller would have to pass the allocated structure into the function.

like image 52
Jay Miller Avatar answered Jan 01 '26 19:01

Jay Miller