【发布时间】:2017-07-08 18:02:33
【问题描述】:
我需要你的帮助
if(s[i]==t)
{
//I get error for this
//aSP[pos] = min( (dfs(i)+pow(i-pos,2)) , aSP[pos] );
//Then I replace the above code with the following codes, and then it worked
int a = (dfs(i)+pow(i-pos,2));
int b = aSP[pos];
aSP[pos] = min(a,b);
}
但它们相同对吗?为什么我从 Eclipse 收到错误消息?
它说
描述资源路径位置类型 无效参数 ' 候选人是: const #0 & min(const #0 &, const #0 &)
描述资源路径位置类型没有匹配的调用函数 到 'min(__gnu_cxx::__promote_2::__type, int&)' ColorfulRoad.h /colorfulroad-c++ line 53 C/C++ 问题
还有一些其他信息,比如参数类型冲突、模板参数推导/替换失败..
【问题讨论】:
标签: c++ eclipse templates arguments min