| 22 | } |
| 23 | |
| 24 | bool is_int(const std::string& str) |
| 25 | { |
| 26 | if (!str.empty()) |
| 27 | { |
| 28 | if (str.substr(0, 1) == "-") |
| 29 | return std::all_of(str.begin() + 1, str.end(), is_digit); |
| 30 | return std::all_of(str.begin(), str.end(), is_digit); |
| 31 | } |
| 32 | return false; |
| 33 | } |
| 34 | |
| 35 | bool is_float(const std::string& str) |
| 36 | { |
no test coverage detected