Hello I am working with C++ built-in algorithms. I have this code here:
#include <string>
#include <algorithm>
#include <iterator>
using namespace std;
bool isDon(string& name) const {
return name == "Don";
}
string names[] = {"George", "Don", "Estelle", "Mike", "Bob"};
int main() {
string* ptr;
ptr = find_if(names, names+5, isDon);
return 0;
}
When I run this program, compiler gives me an error ,in which my isDon()
function decleration resides, which says that I cannot use a cv-qualifier in that function decleration. Why is that?