absl::from_chars

Workalike compatibility version of std::from_chars from C++17 for float.

Synopsis

Declared in <absl/strings/charconv.h>

absl::from_chars_result
from_chars(
    char const* first,
    char const* last,
    float& value,
    chars_format fmt = chars_format::general);

Return Value

A from_chars_result describing where parsing stopped and any error.

Parameters

NameDescription
firstPointer to the first character of the input range.
lastPointer to one past the last character of the input range.
valueSet to the parsed number when a match is found.
fmtThe floating-point format to accept.