| 121 | * @return T Returned numeric value |
| 122 | */ |
| 123 | template <typename T> T from_string(const std::string &s, std::ios_base & (*f)(std::ios_base&)) |
| 124 | { |
| 125 | T t; |
| 126 | std::istringstream iss(s); |
| 127 | iss >> f, iss >> t; |
| 128 | return t; |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * @brief Convert any value from a string to another type using stringstream. |