Skip to content

Instantly share code, notes, and snippets.

@quxiao
Created April 6, 2014 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quxiao/10004846 to your computer and use it in GitHub Desktop.
Save quxiao/10004846 to your computer and use it in GitHub Desktop.
int count(const std::vector<std::string>& str_vec, const size_t threshold)
{
int size = 0;
std::vector<std::string>::const_iterator it;
for (it = str_vec.begin(); it != str_vec.end(); ++ it) {
if (it->length() < threshold) {
++ size;
}
}
return size;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment