Move from std::atoi to std::from_char
C++17's std::from_chars
is supposed to be faster and more modern than std::atoi
/std::stof
, so we should migrate to it.
Unlike other parsing functions in C++ and C libraries, std::from_chars is locale-independent, non-allocating, and non-throwing. Only a small subset of parsing policies used by other libraries (such as std::sscanf) is provided. This is intended to allow the fastest possible implementation that is useful in common high-throughput contexts such as text-based interchange (JSON or XML).
Edited by jvoisin