18 inline T
str2number(
const char *str,
int base,
bool safe)
25 const __int64 val=_strtoi64(str, &endptr, base);
27 const long long val=strtoll(str, &endptr, base);
35 if(std::numeric_limits<T>::min()==0)
40 (
unsigned long long)(T)val<=
41 (
unsigned long long)std::numeric_limits<T>::max());
46 CHECK_RETURN(val<=(
long long)std::numeric_limits<T>::max());
47 CHECK_RETURN(val>=(
long long)std::numeric_limits<T>::min());
56 return str2number<unsigned>(str.c_str(), base,
true);
61 return str2number<std::size_t>(str.c_str(), base,
true);
66 return str2number<int>(str.c_str(), base,
false);
71 return str2number<unsigned>(str.c_str(), base,
false);
76 return str2number<std::size_t>(str.c_str(), base,
false);
80 const std::string &str,
83 return str2number<signed long long int>(str.c_str(), base,
false);
87 const std::string &str,
90 return str2number<unsigned long long int>(str.c_str(), base,
false);