Created
December 9, 2015 13:39
-
-
Save thiagomg/d9877aaac2f86b7b1759 to your computer and use it in GitHub Desktop.
Legibilidade com C++14 - get_numeric
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
T get_numeric(const T &input) | |
{ | |
T output; | |
std::for_each(begin(input), end(input), [&output](auto c) { | |
if( c >= '0' && c <= '9' ) output.push_back(c); | |
}); | |
return output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment