Avoid std::from_chars for now

This commit is contained in:
trilene 2020-10-29 19:42:05 -04:00
parent 51a559ab4a
commit 2838061f10

View file

@ -2,7 +2,6 @@
#include <QQuickItem> #include <QQuickItem>
#include <algorithm> #include <algorithm>
#include <cctype> #include <cctype>
#include <charconv>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <optional> #include <optional>
@ -129,10 +128,9 @@ std::pair<int, int>
tokenise(std::string_view str, char delim) tokenise(std::string_view str, char delim)
{ {
std::pair<int, int> ret; std::pair<int, int> ret;
ret.first = std::atoi(str.data());
auto pos = str.find_first_of(delim); auto pos = str.find_first_of(delim);
auto s = str.data(); ret.second = std::atoi(str.data() + pos + 1);
std::from_chars(s, s + pos, ret.first);
std::from_chars(s + pos + 1, s + str.size(), ret.second);
return ret; return ret;
} }