MCPcopy Create free account
hub / github.com/covscript/covscript / string>

Method string>

include/covscript/impl/type_ext.hpp:624–631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

622
623 template <>
624 std::intptr_t to_integer<std::string>(const std::string &str)
625 {
626 for (auto &ch : str) {
627 if (!std::isdigit(ch))
628 throw cs::runtime_error("Wrong literal format.");
629 }
630 return std::stol(str);
631 }
632
633// Hash
634 template <>

Callers

nothing calls this directly

Calls 5

isdigitFunction · 0.85
runtime_errorClass · 0.85
lang_errorClass · 0.85
sizeMethod · 0.80
to_stringMethod · 0.45

Tested by

no test coverage detected