#include <iostream>
#include <tuple>
#include <string>
std::tuple<std::string, int, double> getPersonInfo() {
return std::make_tuple("Alice", 25, 1.65);
}
int main() {
// Using std::tie for unpacking
std::string name;
int age;
double height;
std::tie(name, age, height) = getPersonInfo();
std::cout << "Name: " << name << ", Age: " << age << ", Height: " << height << " m" << std::endl;
// Using structured bindings (C++17)
auto [name2, age2, height2] = getPersonInfo();
std::cout << "Name: " << name2 << ", Age: " << age2 << ", Height: " << height2 << " m" << std::endl;
// Ignoring some values
std::string title;
int year;
std::tie(title, std::ignore, year) = std::make_tuple("The Catcher in the Rye", "J.D. Salinger", 1951);
std::cout << "Book: " << title << ", Year: " << year << std::endl;
return 0;
}