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;

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;

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;

Assigns an AnyInvocable from an existing AnyInvocable instance.

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

Return Value

A reference to *this.

Parameters

Name

Description

f

The AnyInvocable to move from.

unused

Unused parameter.

Created with MrDocs