[#absl-AnyInvocable-2conversion]
= xref:absl.adoc[absl]::xref:absl/AnyInvocable.adoc[AnyInvocable]::operator bool
:relfileprefix: ../../
:mrdocs:

absl&colon;&colon;AnyInvocable&colon;&colon;operator bool()

== Synopsis

Declared in `&lt;absl&sol;functional&sol;any&lowbar;invocable&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
operator bool() const noexcept;
----

== Description

Returns `true` if `&ast;this` is not empty&period;

WARNING&colon; An `AnyInvocable` that wraps an empty `std&colon;&colon;function` is not itself empty&period; This behavior is consistent with the standard equivalent `std&colon;&colon;move&lowbar;only&lowbar;function`&period; In the following example, `a()` will actually invoke `f()`, leading to an `std&colon;&colon;bad&lowbar;function&lowbar;call` exception&colon; std&colon;&colon;function&lt;void()&gt; f&semi; &sol;&sol; empty absl&colon;&colon;AnyInvocable&lt;void()&gt; a &equals; f&semi; &sol;&sol; not empty

Invoking an empty `AnyInvocable` results in undefined behavior&period;

== Return Value

`true` if `&ast;this` is not empty&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
