Fixed previous commit for Linux/OSX

This commit is contained in:
Vojtech Bubnik 2020-10-29 13:16:32 +01:00
parent 1130d78c19
commit 5ccd9d9d9a

View file

@ -977,7 +977,9 @@ template<typename T>
{
// Legacy conversion, which is costly due to having to make a copy of the string before conversion.
try {
std::string str { str };
assert(sv.size() < 1024);
assert(sv.data() != nullptr);
std::string str { sv };
size_t read = 0;
if constexpr (std::is_same_v<T, int>)
out = std::stoi(str, &read);