| 5846 | |
| 5847 | template<typename T> |
| 5848 | inline auto convertInto( std::string const &source, T& target ) -> ParserResult { |
| 5849 | std::stringstream ss; |
| 5850 | ss << source; |
| 5851 | ss >> target; |
| 5852 | if( ss.fail() ) |
| 5853 | return ParserResult::runtimeError( "Unable to convert '" + source + "' to destination type" ); |
| 5854 | else |
| 5855 | return ParserResult::ok( ParseResultType::Matched ); |
| 5856 | } |
| 5857 | inline auto convertInto( std::string const &source, std::string& target ) -> ParserResult { |
| 5858 | target = source; |
| 5859 | return ParserResult::ok( ParseResultType::Matched ); |
no test coverage detected