| 501 | namespace { |
| 502 | template <typename Func> |
| 503 | bool find_first_in(std::string_view s, const char *delims, Func&& f) |
| 504 | { |
| 505 | auto pos = s.find_first_not_of(delims); |
| 506 | while (pos != s.npos) { |
| 507 | s.remove_prefix(pos); |
| 508 | auto end = s.find_first_of(delims); |
| 509 | if (f(s.substr(0, end))) { |
| 510 | return true; |
| 511 | } |
| 512 | pos = s.find_first_not_of(delims, end); |
| 513 | } |
| 514 | return false; |
| 515 | } |
| 516 | |
| 517 | template<typename T> |
| 518 | T str_to_num(const std::string& s) |
no test coverage detected