Questions tagged «stdtuple»

20
您如何遍历std :: tuple的元素?
我如何遍历一个元组(使用C ++ 11)?我尝试了以下方法: for(int i=0; i<std::tuple_size<T...>::value; ++i) std::get<i>(my_tuple).do_sth(); 但这不起作用: 错误1:抱歉,未实现:无法将“侦听器...”扩展为固定长度的参数列表。 错误2:我无法出现在常量表达式中。 那么,如何正确遍历元组的元素?

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.