I wrote the following lambda expression in my code:
auto fnd_rpt_chrs = [&] (string::iterator& iter_arg) {
for(auto iter = iter_arg + 1; iter != s2.end(); ++iter){
if(*iter == *iter_arg)
return true;
}
return false;
};
Elsewhere, I invoke the lambda in the following manner:
void some_function(string const& s2){
auto iter = s2.begin();
fnd_rpt_chrs(iter);
}
For the above, I get the following compilation error:
no known conversion from 'std::__1::__wrap_iter' to 'string::iterator &' (aka '__wrap_iter &') for 1st argument
Can someone point out what am I missing here?
TIA
Vinod
Aucun commentaire:
Enregistrer un commentaire