[#absl-SetFlag-00] = xref:absl.adoc[absl]::SetFlag :relfileprefix: ../ :mrdocs: `SetFlag` overloads == Synopses Declared in `<absl/flags/flag.h>` 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> void xref:absl/SetFlag-0d.adoc[SetFlag]( xref:absl/Flag.adoc[absl::Flag<T>]* flag, T const& v); ---- [.small]#xref:absl/SetFlag-0d.adoc[_» more..._]# Overload of `SetFlag()` to allow callers to pass in a value that is convertible to `T`. E.g., use this overload to pass a "const char*" when `T` is `std::string`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename T, typename V> void xref:absl/SetFlag-07.adoc[SetFlag]( xref:absl/Flag.adoc[absl::Flag<T>]* flag, V const& v); ---- [.small]#xref:absl/SetFlag-07.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *flag* | The flag to update. | *v* | The new value to assign to `flag`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#