📜  获取元组的元素 c++ 代码示例

📅  最后修改于: 2022-03-11 14:44:57.813000             🧑  作者: Mango

代码示例1
#include 
#include 
int main()
{
    auto t = std::make_tuple(1, "Foo", 3.14);
    // index-based access
    std::cout << "(" << std::get<0>(t) << ", " << std::get<1>(t)
              << ", " << std::get<2>(t) << ")\n";
}