Skip to content

Instantly share code, notes, and snippets.

@thiagomg
Last active December 17, 2015 10:37
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 thiagomg/ade42c7a04e70c448760 to your computer and use it in GitHub Desktop.
Save thiagomg/ade42c7a04e70c448760 to your computer and use it in GitHub Desktop.
Legibilidade com C++14 - get_numeric
template<typename T>
T get_numeric(const T &input)
{
T output;
std::copy_if(begin(input), end(input), std::back_inserter(output), [](auto c) {
return ( c >= '0' && c <= '9' );
});
return output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment