| 8751 | |
| 8752 | template<typename T> |
| 8753 | inline auto convertInto( std::string const &source, T& target ) -> ParserResult { |
| 8754 | std::stringstream ss; |
| 8755 | ss << source; |
| 8756 | ss >> target; |
| 8757 | if( ss.fail() ) |
| 8758 | return ParserResult::runtimeError( "Unable to convert '" + source + "' to destination type" ); |
| 8759 | else |
| 8760 | return ParserResult::ok( ParseResultType::Matched ); |
| 8761 | } |
| 8762 | inline auto convertInto( std::string const &source, std::string& target ) -> ParserResult { |
| 8763 | target = source; |
| 8764 | return ParserResult::ok( ParseResultType::Matched ); |
no test coverage detected