[#absl-AnyInvocable-2constructor-01] = xref:absl.adoc[absl]::xref:absl/AnyInvocable.adoc[AnyInvocable]::AnyInvocable :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<absl/functional/any_invocable.h>` Constructs the `AnyInvocable` in an empty state. Invoking it results in undefined behavior. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:absl/AnyInvocable/2constructor-03.adoc[AnyInvocable]() noexcept = default; ---- [.small]#xref:absl/AnyInvocable/2constructor-03.adoc[_» more..._]# Constructs the `AnyInvocable` from an existing `AnyInvocable` by a move. Note that `f` is not guaranteed to be empty after move‐construction, although it may be. [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..._]# Constructs the `AnyInvocable` in an empty state from a null pointer. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:absl/AnyInvocable/2constructor-04.adoc[AnyInvocable](std::nullptr_t unused) noexcept; ---- [.small]#xref:absl/AnyInvocable/2constructor-04.adoc[_» more..._]# Constructs an `AnyInvocable` from an invocable object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class F> requires internal_any_invocable::CanConvert<Sig, F>::value xref:absl/AnyInvocable/2constructor-00.adoc[AnyInvocable](F&& f); ---- [.small]#xref:absl/AnyInvocable/2constructor-00.adoc[_» more..._]# Constructs an `AnyInvocable` that holds an invocable object of type `T`, which is constructed in‐place from the given arguments. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class T, class... Args> requires internal_any_invocable::CanEmplace<Sig, T, Args...>::value explicit xref:absl/AnyInvocable/2constructor-02.adoc[AnyInvocable]( std::in_place_type_t<T> tag, Args&&... args); ---- [.small]#xref:absl/AnyInvocable/2constructor-02.adoc[_» more..._]# Overload of the above constructor to support list‐initialization. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class T, class U, class... Args> requires internal_any_invocable::CanEmplace< Sig, T, std::initializer_list<U>&, Args...>::value explicit xref:absl/AnyInvocable/2constructor-0f.adoc[AnyInvocable]( std::in_place_type_t<T> tag, std::initializer_list<U> ilist, Args&&... args); ---- [.small]#xref:absl/AnyInvocable/2constructor-0f.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *f* | The `AnyInvocable` to move from. | *unused* | Unused parameter. | *args* | Arguments forwarded to the constructor of `T`. | *tag* | A tag that selects this overload. | *ilist* | Initializer list forwarded to the constructor of `T`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#