这是我的代码片段:
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
bool next(int j)
{
return(j<3);
}
int main()
{
......
cin>>m;
int h[m];
memset(h, 0, sizeof(h));
.......
int *p;
p = find_if(h, h+m, next);
......
}
Run Code Online (Sandbox Code Playgroud)
编译时我收到以下错误:
没有用于调用'find_if(int*,int*,)'的匹配函数
template _IIter std :: find_if(_IIter,_IIter,_Predicate)
模板参数扣除/替换失败:
无法推断模板参数'_Predicate'