template <class Sig>
class AnyInvocable
Defined at line 155 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
Defined in functional/any_invocable.h
Public Methods
void AnyInvocable<Sig> ()
Constructs the `AnyInvocable` in an empty state.
Defined at line 170 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
void AnyInvocable<Sig> (std::nullptr_t )
Defined at line 171 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
void AnyInvocable<Sig> (AnyInvocable<Sig> && )
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.
Defined at line 176 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
template <class F, typename = absl::enable_if_t<
internal_any_invocable::CanConvert<Sig, F>::value>>
void AnyInvocable<Sig> (F && f)
Constructs an `AnyInvocable` from an invocable object.
Upon construction, `*this` is only empty if `f` is a function pointer or
member pointer type and is null, or if `f` is an `AnyInvocable` that is
empty.
Defined at line 185 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
template <class T, class... Args, typename = absl::enable_if_t<
internal_any_invocable::CanEmplace<Sig, T, Args...>::value>>
void AnyInvocable<Sig> (absl::in_place_type_t<T> , Args &&... args)
Constructs an `AnyInvocable` that holds an invocable object of type `T`,
which is constructed in-place from the given arguments.
Example:
AnyInvocable
<int
(int)> func(
absl::in_place_type
<PossiblyImmovableType
>, arg1, arg2);
Defined at line 200 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
template <class T, class U, class... Args, typename = absl::enable_if_t<internal_any_invocable::CanEmplace<
Sig, T, std::initializer_list<U>&, Args...>::value>>
void AnyInvocable<Sig> (absl::in_place_type_t<T> , std::initializer_list<U> ilist, Args &&... args)
Overload of the above constructor to support list-initialization.
Defined at line 212 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
AnyInvocable<Sig> & operator= (AnyInvocable<Sig> && )
Assigns an `AnyInvocable` through move-assignment.
Note that `f` is not guaranteed to be empty after move-assignment
although it may be.
Defined at line 226 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
AnyInvocable<Sig> & operator= (std::nullptr_t )
Assigns an `AnyInvocable` from a nullptr, clearing the `AnyInvocable`. If
not empty, destroys the target, putting `*this` into an empty state.
Defined at line 230 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
template <class F, typename = absl::enable_if_t<
internal_any_invocable::CanAssign<Sig, F>::value>>
AnyInvocable<Sig> & operator= (F && f)
Assigns an `AnyInvocable` from an existing `AnyInvocable` instance.
Upon assignment, `*this` is only empty if `f` is a function pointer or
member pointer type and is null, or if `f` is an `AnyInvocable` that is
empty.
Defined at line 242 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
template <class F, typename = absl::enable_if_t<
internal_any_invocable::CanAssignReferenceWrapper<Sig, F>::value>>
AnyInvocable<Sig> & operator= (std::reference_wrapper<F> f)
Assigns an `AnyInvocable` from a reference to an invocable object.
Upon assignment, stores a reference to the invocable object in the
`AnyInvocable` instance.
Defined at line 254 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
void ~AnyInvocable<Sig> ()
If not empty, destroys the target.
Defined at line 262 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
void swap (AnyInvocable<Sig> & other)
absl::AnyInvocable::swap()
Exchanges the targets of `*this` and `other`.
Defined at line 267 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
bool operator bool ()
absl::AnyInvocable::operator bool()
Returns `true` if `*this` is not empty.
WARNING: An `AnyInvocable` that wraps an empty `std::function` is not
itself empty. This behavior is consistent with the standard equivalent
`std::move_only_function`.
In other words:
std::function
<void
()> f; // empty
absl::AnyInvocable
<void
()> a = std::move(f); // not empty
Defined at line 280 of file ../../third_party/abseil-cpp/absl/functional/any_invocable.h
Friends
template <bool, class, class>
class CoreImpl
template <class Sig>
void AnyInvocable (AnyInvocable<Sig> & f1, AnyInvocable<Sig> & f2)
template <class Sig>
bool AnyInvocable (std::nullptr_t , const AnyInvocable<Sig> & f)
template <class Sig>
bool AnyInvocable (const AnyInvocable<Sig> & f, std::nullptr_t )
template <class Sig>
bool AnyInvocable (std::nullptr_t , const AnyInvocable<Sig> & f)
template <class Sig>
bool AnyInvocable (const AnyInvocable<Sig> & fstd::nullptr_t )