Skip to content

Instantly share code, notes, and snippets.

@Pethaf
Created April 11, 2017 20:03
Show Gist options
  • Save Pethaf/2950985d0b0b2ac75bc5fa1faea6d134 to your computer and use it in GitHub Desktop.
Save Pethaf/2950985d0b0b2ac75bc5fa1faea6d134 to your computer and use it in GitHub Desktop.
auto last2 = std::remove_if(std::begin(words),std::end(words),[&forbiddenWords](const std::string& word)
{ return (std::find(std::begin(forbiddenWords),std::end(forbiddenWords),word) != end(forbiddenWords)); });
words.erase(last2,std::end(words));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment