7

Are there any compilers capable of performing return value optimization on multiple values returned from a function through std::tuple? 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();
Fred Nurk
  • 13,508
  • 4
  • 35
  • 61
tgoodhart
  • 3,027
  • 23
  • 35

1 Answers1

4

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

Community
  • 1
  • 1
fredoverflow
  • 246,999
  • 92
  • 370
  • 646