When a function need to return two parameters you can write it using a std::pair:
std::pair<int, int> f()
{return std::make_pair(1,2);}
And if you want to use it, you can write this:
int one, two;
std::tie(one, two) = f();
The problem with this approach is that you need to define 'one' and 'two' and then assign them to the return value of f(). It would be better if we can write something like
auto {one, two} = f();
I watched a lecture (I don't remember which one, sorry) in which the speaker said that the C++ standard people where trying to do something like that. I think this lecture is from 2 years ago. Does anyone know if right now (in almost c++17) you can do it or something similar?