Here's my code snippet:
#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);
......
}
I'm getting the following error upon compilation:
no matching function for call to ‘find_if(int*, int*, )’
template _IIter std::find_if(_IIter, _IIter, _Predicate)
template argument deduction/substitution failed:
couldn't deduce template parameter ‘_Predicate’