mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
std::stod replaced to std::from_chars
This commit is contained in:
parent
1f11fa8fea
commit
ece68e715d
1 changed files with 4 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "xml.h"
|
||||
|
||||
#include <charconv>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include "../util/stringutil.h"
|
||||
|
|
@ -24,7 +25,9 @@ int64_t Attribute::asInt() const {
|
|||
}
|
||||
|
||||
double Attribute::asFloat() const {
|
||||
return std::stod(text);
|
||||
double value;
|
||||
std::from_chars(text.data(), text.data()+text.size(), value);
|
||||
return value;
|
||||
}
|
||||
|
||||
bool Attribute::asBool() const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue