| 8984 | |
| 8985 | template<typename T> |
| 8986 | inline auto convertInto( std::string const &source, T& target ) -> ParserResult { |
| 8987 | std::stringstream ss; |
| 8988 | ss << source; |
| 8989 | ss >> target; |
| 8990 | if( ss.fail() ) |
| 8991 | return ParserResult::runtimeError( "Unable to convert '" + source + "' to destination type" ); |
| 8992 | else |
| 8993 | return ParserResult::ok( ParseResultType::Matched ); |
| 8994 | } |
| 8995 | inline auto convertInto( std::string const &source, std::string& target ) -> ParserResult { |
| 8996 | target = source; |
| 8997 | return ParserResult::ok( ParseResultType::Matched ); |
no test coverage detected