[#absl-AnyInvocable-2conversion] = xref:absl.adoc[absl]::xref:absl/AnyInvocable.adoc[AnyInvocable]::operator bool :relfileprefix: ../../ :mrdocs: absl::AnyInvocable::operator bool() == Synopsis Declared in `<absl/functional/any_invocable.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit operator bool() const noexcept; ---- == Description Returns `true` if `*this` is not empty. WARNING: An `AnyInvocable` that wraps an empty `std::function` is not itself empty. This behavior is consistent with the standard equivalent `std::move_only_function`. In the following example, `a()` will actually invoke `f()`, leading to an `std::bad_function_call` exception: std::function<void()> f; // empty absl::AnyInvocable<void()> a = f; // not empty Invoking an empty `AnyInvocable` results in undefined behavior. == Return Value `true` if `*this` is not empty. [.small]#Created with https://www.mrdocs.com[MrDocs]#