I'm looking for a short (and fast) code to check whether a string contains only digits, specifically looking for a one liner. This is my temporary code:
bool IsNumber(const std::string& str)
{
int i = 0;
for( ; i<str.size() && isdigit(str[i]); ++i);
return ( i == str.size() );
}