I cant figere out if RVO (return value optimalization) is guaranteed to happen in case of std::pair assigment with [] syntax. Exapmple:
std::pair<vector<double>,vector<double> > my_funct() {
std::pair<vector<double>, vector<double> > _result;
auto& [x, y] = _result;
// do some calculation and fill up x, y
return _result;
}
int main() {
// auto result = my_funct(); // RVO is guranteed in this case.
auto [x, y] = my_funct(); // Does Return value optimalization happens (guranteed by c++17)?
return 0;
}