Note that this won't work (AFAICT) with Unicode strings and non-western-arabic digits, e.g.:
std::u8string_view chars{ u8"۱۲۳٤" };
int value;
enum { digit_base = 10 };
auto [ptr, ec] = std::from_chars(
chars.data(), chars.data() + chars.size(), value, digit_base);
return (ec == std::errc{}) ? value : -1;
will fail to compile due to pointer incompatibility.