| 6957 | |
| 6958 | template<typename T> |
| 6959 | inline auto convertInto( std::string const &source, T& target ) -> ParserResult { |
| 6960 | std::stringstream ss; |
| 6961 | ss << source; |
| 6962 | ss >> target; |
| 6963 | if( ss.fail() ) |
| 6964 | return ParserResult::runtimeError( "Unable to convert '" + source + "' to destination type" ); |
| 6965 | else |
| 6966 | return ParserResult::ok( ParseResultType::Matched ); |
| 6967 | } |
| 6968 | inline auto convertInto( std::string const &source, std::string& target ) -> ParserResult { |
| 6969 | target = source; |
| 6970 | return ParserResult::ok( ParseResultType::Matched ); |
no test coverage detected