| 198 | |
| 199 | template<typename T> |
| 200 | T fromString(const std::string& s) { |
| 201 | std::istringstream stream(s); |
| 202 | T t; |
| 203 | stream >> t; |
| 204 | if (stream.fail()) { |
| 205 | throw std::invalid_argument("Cannot convert parameter"); |
| 206 | } |
| 207 | return t; |
| 208 | } |
| 209 | |
| 210 | template<> |
| 211 | inline std::string fromString(const std::string& s) { |