如何解决当我使用模板定义模板参数时,出现错误“标识符未定义”
我想使用模板定义可以在数组引用中使用的参数。但是在模板之后,有错误:
error:'N':undeclared identifier.
,error: identifier N is not defined.
,错误:'void DoubleThresholdLink(float (&)[1],double,double)': cannot convert argument 1 from 'float [397782]' to 'float (&)[1]'
这是代码:
template <int N>
void DoubleThresholdLink( float (&input)[N],double lowThreshold,double highThreshold)
int main(void) {
static float image_out[397782] = {};
DoubleThresholdLink(image_out,50,150);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。