【发布时间】:2016-10-26 17:30:56
【问题描述】:
我有以下问题:
template< typename callable, typename T , size_t... N_i>
void foo()
{
using callable_out_type = std::result_of_t< callable( /* T , ... , T <- sizeof...(N_i) many */ ) >;
// ...
}
我想得到callable 的结果类型,它将sizeof...(N_i) 类型为T 的许多参数作为其输入,例如callable(1,2,3) 在T==int 和sizeof...(N_i)==3 的情况下。如何实现?
非常感谢。
【问题讨论】:
-
也许看看
std::integer_sequence会有帮助。