0
在下面的示例中,我想將整數列表轉換爲字符串元組並將其作爲std::tuple
的std::string
s返回。我如何實現這一目標?如何將函數應用於可變參數列表並將它們映射到元組
std::string to_str(int i) {
return std::to_string(i);
}
template <typename... int>
auto generate_tuple_string(int... ints) {
// what to do here?
}
理想情況下,to_str()
可以是返回相同(或不同)類型的其他函數。返回類型應該是std::tuple
將它們連接在一起。
@ Rakete1111 - D'ho!當然不是。謝謝。 – max66