|
|
|
@ -10,16 +10,16 @@ namespace std {
|
|
|
|
|
|
|
|
|
|
// Can't believe this is not in the standard library
|
|
|
|
|
|
|
|
|
|
inline uint32_t stou(const char* string) |
|
|
|
|
inline uint32_t stou(const std::string& string) |
|
|
|
|
{ |
|
|
|
|
unsigned long size = std::stoul(string); |
|
|
|
|
ASSERT(size <= std::numeric_limits<uint32_t>::max(), "String util not in uint32_t range '{}'", string); |
|
|
|
|
return static_cast<uint32_t>(size); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inline uint32_t stou(const std::string& string) |
|
|
|
|
inline uint32_t stou(const char* string) |
|
|
|
|
{ |
|
|
|
|
return stou(string.c_str()); |
|
|
|
|
return stou(std::string(string)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} // namespace std
|
|
|
|
|