[#absl-AnyInvocable-2constructor-01]
= xref:absl.adoc[absl]::xref:absl/AnyInvocable.adoc[AnyInvocable]::AnyInvocable
:relfileprefix: ../../
:mrdocs:

Constructors

== Synopses

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

Constructs the `AnyInvocable` in an empty state&period; Invoking it results in undefined behavior&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/AnyInvocable/2constructor-03.adoc[AnyInvocable]() noexcept = default;
----

[.small]#xref:absl/AnyInvocable/2constructor-03.adoc[_» more&period;&period;&period;_]#

Constructs the `AnyInvocable` from an existing `AnyInvocable` by a move&period; Note that `f` is not guaranteed to be empty after move&hyphen;construction, although it may be&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/AnyInvocable/2constructor-0c.adoc[AnyInvocable](xref:absl/AnyInvocable.adoc[AnyInvocable]&& f) noexcept = default;
----

[.small]#xref:absl/AnyInvocable/2constructor-0c.adoc[_» more&period;&period;&period;_]#

Constructs the `AnyInvocable` in an empty state from a null pointer&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/AnyInvocable/2constructor-04.adoc[AnyInvocable](std::nullptr&lowbar;t unused) noexcept;
----

[.small]#xref:absl/AnyInvocable/2constructor-04.adoc[_» more&period;&period;&period;_]#

Constructs an `AnyInvocable` from an invocable object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
requires internal&lowbar;any&lowbar;invocable&colon;&colon;CanConvert&lt;Sig, F&gt;&colon;&colon;value
xref:absl/AnyInvocable/2constructor-00.adoc[AnyInvocable](F&& f);
----

[.small]#xref:absl/AnyInvocable/2constructor-00.adoc[_» more&period;&period;&period;_]#

Constructs an `AnyInvocable` that holds an invocable object of type `T`, which is constructed in&hyphen;place from the given arguments&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class T,
    class&period;&period;&period; Args&gt;
requires internal&lowbar;any&lowbar;invocable&colon;&colon;CanEmplace&lt;Sig, T, Args&period;&period;&period;&gt;&colon;&colon;value
explicit
xref:absl/AnyInvocable/2constructor-02.adoc[AnyInvocable](
    std::in&lowbar;place&lowbar;type&lowbar;t&lt;T&gt; tag,
    Args&&&period;&period;&period; args);
----

[.small]#xref:absl/AnyInvocable/2constructor-02.adoc[_» more&period;&period;&period;_]#

Overload of the above constructor to support list&hyphen;initialization&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class T,
    class U,
    class&period;&period;&period; Args&gt;
requires internal&lowbar;any&lowbar;invocable&colon;&colon;CanEmplace&lt;
                Sig, T, std&colon;&colon;initializer&lowbar;list&lt;U&gt;&amp;, Args&period;&period;&period;&gt;&colon;&colon;value
explicit
xref:absl/AnyInvocable/2constructor-0f.adoc[AnyInvocable](
    std::in&lowbar;place&lowbar;type&lowbar;t&lt;T&gt; tag,
    std::initializer&lowbar;list&lt;U&gt; ilist,
    Args&&&period;&period;&period; args);
----

[.small]#xref:absl/AnyInvocable/2constructor-0f.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *f*
| The `AnyInvocable` to move from&period;
| *unused*
| Unused parameter&period;
| *args*
| Arguments forwarded to the constructor of `T`&period;
| *tag*
| A tag that selects this overload&period;
| *ilist*
| Initializer list forwarded to the constructor of `T`&period;
|===


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