开发者

Return value optimization of values unpacked from std::tuple

开发者 https://www.devze.com 2023-02-11 09:44 出处:网络
Are there any compilers capable of performing return value optimization on multiple values returned from a function through std::tupl开发者_开发问答e? To be clear, in the following code, are there any

Are there any compilers capable of performing return value optimization on multiple values returned from a function through std::tupl开发者_开发问答e? To be clear, in the following code, are there any compilers capable of avoiding unnecessary copies?

std::vector<int> a;
std::list<float> b;
std::tie(a,b) = myFunctionThatReturnsAVectorAndList();


It's not worth worrying anymore. If the compiler cannot perform RVO, move semantics will kick in.

0

精彩评论

暂无评论...
验证码 换一张
取 消