mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
assume dec unless 0x
This commit is contained in:
@ -622,6 +622,12 @@ inline uint64_t StringTo(const std::string &s) {
|
||||
return std::stoull(s, nullptr, base);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline int StringTo(const std::string &s) {
|
||||
int base = s.find("0x") != std::string::npos ? 16 : 10;
|
||||
return std::stoi(s, nullptr, base);
|
||||
}
|
||||
|
||||
/** For types with a .str() method use this for conversion */
|
||||
template <typename T>
|
||||
typename std::enable_if<has_str<T>::value, std::string>::type
|
||||
|
Reference in New Issue
Block a user