Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
void mismatch(const char* dic_path, std::istream& istr)
{
std::unordered_set<std::string> dic;
std::ifstream ifs;
ifs.open(dic_path, std::ifstream::in);
if (ifs.is_open())
{
std::string buffer;
while (std::getline(ifs, buffer))
{
dic.emplace(std::move(buffer));
}
}
ifs.close();
if (!dic.empty())
{
std::string s;
while (std::getline(istr, s))
{
if (dic.find(s) == dic.end())
{
std::cout << s << std::endl;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment