| 210 | |
| 211 | |
| 212 | template <typename T> std::optional<T> from_string(std::string const& s) |
| 213 | { |
| 214 | T value; |
| 215 | try { value = sto_number<T>(s); } |
| 216 | catch (std::invalid_argument&) { return std::nullopt; } |
| 217 | catch (std::out_of_range&) { return std::nullopt; } |
| 218 | return value; |
| 219 | } |
| 220 | |
| 221 | // generic number & vector parsing |
| 222 |
nothing calls this directly
no outgoing calls
no test coverage detected