| 10 | { |
| 11 | constexpr auto is_digit = static_cast<int (*)(int)>(std::isdigit); |
| 12 | size_t count(const std::string& str, const std::string& occur) |
| 13 | { |
| 14 | int occurrences = 0; |
| 15 | std::string::size_type start = 0; |
| 16 | while ((start = str.find(occur, start)) != std::string::npos) |
| 17 | { |
| 18 | ++occurrences; |
| 19 | start += occur.length(); |
| 20 | } |
| 21 | return occurrences; |
| 22 | } |
| 23 | |
| 24 | bool is_int(const std::string& str) |
| 25 | { |