I am learning about tuples and have came across std::tie, and I just can not figure out the reason for it. Could someone explain the point in it? Is it just so i dont need to use get<> on the actual tuple itself, and instead i can use the variable that is a reference to that variable of the tuple?
std::tie creates a tuple containing lvalue references.
Because the resultant tuple contains lvalue referencesm it can be used for unpacking.
In the example: std::tie (myint, std::ignore, mychar) creates a tuple containing references to myint and mychar
std::tie (myint, std::ignore, mychar) = mytuple assigns one tuple to another;
since the tuple on the left hand side holds references, it assigns to myint and mychar