46 const std::string &str,
49 return std::strtoll(str.c_str(),
nullptr,
false);
53 const std::string &str,
64std::optional<unsigned>
70std::optional<std::size_t>
output_type narrow_cast(input_type value)
Alias for static_cast intended to be used for numeric casting Rationale: Easier to grep than static_c...
#define CHECK_RETURN(CONDITION)
std::optional< std::size_t > string2optional_size_t(const std::string &str, int base)
Convert string to size_t similar to the stoul or stoull functions, return nullopt when the conversion...
std::size_t unsafe_string2size_t(const std::string &str, int base)
int unsafe_string2int(const std::string &str, int base)
unsigned long long int unsafe_string2unsignedlonglong(const std::string &str, int base)
unsigned safe_string2unsigned(const std::string &str, int base)
unsigned unsafe_string2unsigned(const std::string &str, int base)
std::size_t safe_string2size_t(const std::string &str, int base)
std::optional< unsigned > string2optional_unsigned(const std::string &str, int base)
Convert string to unsigned similar to the stoul or stoull functions, return nullopt when the conversi...
signed long long int unsafe_string2signedlonglong(const std::string &str, int base)
std::optional< int > string2optional_int(const std::string &str, int base)
Convert string to integer as per stoi, but return nullopt when stoi would throw.
std::optional< T > string2optional(const std::string &str, int base=10)
convert a string to an integer, given the base of the representation works with signed and unsigned i...