| 9070 | |
| 9071 | template<typename T> |
| 9072 | inline auto convertInto( std::string const &source, T& target ) -> ParserResult { |
| 9073 | std::stringstream ss; |
| 9074 | ss << source; |
| 9075 | ss >> target; |
| 9076 | if( ss.fail() ) |
| 9077 | return ParserResult::runtimeError( "Unable to convert '" + source + "' to destination type" ); |
| 9078 | else |
| 9079 | return ParserResult::ok( ParseResultType::Matched ); |
| 9080 | } |
| 9081 | inline auto convertInto( std::string const &source, std::string& target ) -> ParserResult { |
| 9082 | target = source; |
| 9083 | return ParserResult::ok( ParseResultType::Matched ); |
no test coverage detected