MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / convertInto

Function convertInto

unittests/catch.hpp:5848–5856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 );

Callers 4

setValueMethod · 0.85
setValueMethod · 0.85
invokeLambdaFunction · 0.85
makeCommandLineParserFunction · 0.85

Calls 3

failMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected