I'm having an issue where when I try to access a string that's the main param in a lambda, the compiler doesn't recognize it as so when I try to call functions using that string.
Here is my code:
void removePunctuation(std::vector<std::string> &inTokens,
std::vector<std::string> &outTokens) {
std::for_each(inTokens.begin(), inTokens.end(), [outTokens](std::string s) {
std::string newS = s;
// newS.erase(std::remove_if(newS.begin(), newS.end(), ispunct));
outTokens.push_back(newS);});
}
And the following error is produced:
a2.cpp:114:19: error: no matching member function for call to 'push_back'
outTokens.push_back(newS);});
I am also getting this sort of error in other functions, when I try to call a function that uses the lambda's string param in its call.
Any help is much appreciated!