67VTK_ALWAYS_INLINE
auto from_chars(
const char* first,
const char* last, T& value,
68 std::chars_format format = std::chars_format::general) -> std::from_chars_result
70 static constexpr std::array<fast_float::chars_format, 5> std_to_fast_float_chars_format = { {
71 fast_float::chars_format::general,
72 fast_float::chars_format::scientific,
73 fast_float::chars_format::fixed,
74 fast_float::chars_format::general,
75 fast_float::chars_format::hex,
77 auto result = fast_float::from_chars<T>(first, last, value,
78 std_to_fast_float_chars_format[
static_cast<std::underlying_type_t<std::chars_format>
>(format)]);
79 return { result.ptr, result.ec };
83VTK_ALWAYS_INLINE
auto from_chars(
const char* first,
const char* last, T& value,
int base = 10)
84 -> std::from_chars_result
86 auto result = fast_float::from_chars<T>(first, last, value, base);
87 return { result.ptr, result.ec };
VTK_ALWAYS_INLINE auto from_chars(const char *first, const char *last, T &value, std::chars_format format=std::chars_format::general) -> std::from_chars_result
Given a char* first and char* last, convert it to a number, and return a from_chars_result;.