27 auto const*
const first = text.data();
28 auto const*
const last = text.data() + text.size();
29 auto const [end, error] = std::from_chars(first, last, value);
30 if (error == std::errc::result_out_of_range)
32 throw std::invalid_argument{
33 fmt::format(
"'{}' must be between {} and {}, got '{}'.", name, std::numeric_limits<T>::min(), std::numeric_limits<T>::max(), text)};
35 if ((error != std::errc{}) || (end != last))
37 throw std::invalid_argument{fmt::format(
"'{}' must be a decimal integer, got '{}'.", name, text)};