absl::AnyInvocable::operator=

Assignment operators

Synopses

Declared in <absl/functional/any_invocable.h>

Assigns an AnyInvocable through move-assignment. Note that f is not guaranteed to be empty after move-assignment although it may be.

AnyInvocable&
operator=(AnyInvocable&& f) noexcept = default;
» more...

Assigns an AnyInvocable from a nullptr, clearing the AnyInvocable. If not empty, destroys the target, putting *this into an empty state.

AnyInvocable&
operator=(std::nullptr_t unused) noexcept;
» more...

Assigns an AnyInvocable from a reference to an invocable object. Upon assignment, stores a reference to the invocable object in the AnyInvocable instance.

template<class F>
requires internal_any_invocable::CanAssignReferenceWrapper<Sig, F>::value
AnyInvocable&
operator=(std::reference_wrapper<F> f) noexcept;
» more...

Assigns an AnyInvocable from an existing AnyInvocable instance.

template<class F>
requires internal_any_invocable::CanAssign<Sig, F>::value
AnyInvocable&
operator=(F&& f);
» more...

Return Value

A reference to *this.

Parameters

NameDescription
fThe AnyInvocable to move from.
unusedUnused parameter.