| 29 | } |
| 30 | |
| 31 | struct Email |
| 32 | { |
| 33 | constexpr std::optional<std::array<std::string_view, 2>> |
| 34 | operator()(std::string_view sv) const |
| 35 | { |
| 36 | auto const d = sv.find("@"); |
| 37 | if (d == std::string_view::npos) |
| 38 | { |
| 39 | return {}; |
| 40 | } |
| 41 | return std::array<std::string_view, 2>{sv.substr(0, d), sv.substr(d + 1)}; |
| 42 | } |
| 43 | }; |
| 44 | |
| 45 | inline constexpr Email email; |
| 46 |
nothing calls this directly
no outgoing calls
no test coverage detected