【发布时间】:2019-05-29 08:10:34
【问题描述】:
模板参数推导允许以下内容还是未推导的上下文?
#include <utility>
#include<tuple>
template<std::size_t... I>
auto make(std::index_sequence<I...> = std::make_index_sequence<2>())
{
return;
}
int main() {
make();
}
【问题讨论】:
-
编译器警告告诉你它“推导出”一个空的
I...,因此它不能将std::index_sequence<0, 1>转换为std::index_sequence<>。
标签: c++ c++17 template-meta-programming template-argument-deduction