absl::SetFlag

Sets the value of an absl::Flag to the value v. Do not construct an absl::Flag<T> directly and call absl::SetFlag(); instead, use the flag's variable name (e.g. FLAGS_name). This function is thread-safe, but is potentially expensive. Avoid setting flags in general, but especially within performance-critical code.

Synopsis

Declared in <absl/flags/flag.h>

template<typename T>
void
SetFlag(
    absl::Flag<T>* flag,
    T const& v);

Parameters

NameDescription
flagThe flag to update.
vThe new value to assign to flag.