The return type of std::tie(myint, std::ignore, mychar)
is
std::tuple<int&, decltype((std::ignore)), char&>
, wherein the int&
is a reference to myint
and the char&
is a reference to mychar
.
When mytuple
is assigned to this returned tuple-of-references, each value in mytuple
is assigned to the respective reference stored in the returned tuple. This has the effect of updating myint
and mychar
in place.
std::tie(myint, std::ignore, mychar) // <-- expression
std::tuple<int&, decltype((std::ignore)), char&> // <-- type
std::tie(myint, std::ignore, mychar) = mytuple;
std::tuple<int&, decltype((std::ignore)), char&> = std::tuple<int, T, char>&;
// functions as
std::tuple<int , T , char >&
// ↓↓ = = = ↓↓
std::tuple<int&, decltype((std::ignore)), char&>
// end result:
myint = std::get<0>(mytuple);
mychar = std::get<2>(mytuple);
int& = int&;
char& = char&;