#Underated #CPlusPlus feature: The type-based variant of std::get().

Often only index-based version of std::get() is tought and people rightfully ask how C++ tuples shall be any good, if you must replace descriptive names by undescriptive, magic numbers.

The thing is: You actually are supposed to use the type-based variant:

tuple<string, world> demo() {
...
return {"Hello", world{}};
}

const auto &result = demo();
println(get<string>(result));

How isn't that nice?

#programming