At a quick glance
bool operator()(int& val) {
for (auto& x : count_of_vowels)
if (x.first > val)
return true;
else
return false;
}
Should be:
bool operator()(int& val) {
for (auto& x : count_of_vowels) {
if (x.first > val)
return true;
}
return false;
}