| 5646 | }; |
| 5647 | |
| 5648 | template <typename T> inline auto convertInto(std::string const &source, T &target) -> ParserResult { |
| 5649 | std::stringstream ss; |
| 5650 | ss << source; |
| 5651 | ss >> target; |
| 5652 | if (ss.fail()) |
| 5653 | return ParserResult::runtimeError("Unable to convert '" + source + "' to destination type"); |
| 5654 | else |
| 5655 | return ParserResult::ok(ParseResultType::Matched); |
| 5656 | } |
| 5657 | inline auto convertInto(std::string const &source, std::string &target) -> ParserResult { |
| 5658 | target = source; |
| 5659 | return ParserResult::ok(ParseResultType::Matched); |
no test coverage detected