如何获取std :: tuple元素的引用?
std::get
void fun(int &a) { a = 15; } void test() { std::tuple<int,char> foo{ 12,'a' }; fun(std::get<0>(foo)); }
演示here.