absl::ParseFlag

Parses a string value into a flag value of type T. Do not add overloads of this function for your type directly; instead, add an AbslParseFlag() free function as documented above.

Synopsis

Declared in <absl/flags/marshalling.h>

template<typename T>
bool
ParseFlag(
    std::string_view input,
    T* dst,
    std::string* error);

Return Value

true if input was successfully parsed into *dst.

Parameters

NameDescription
inputThe string to parse.
dstThe destination to store the parsed value in.
errorSet to an error message when parsing fails.