template <class Sig>
class AnyInvocable
Defined at line 163 of file ../../third_party/abseil-cpp/src/absl/functional/any_invocable.h
Defined in functional/any_invocable.h
Public Methods
void AnyInvocable<Sig> ()
Constructs the `AnyInvocable` in an empty state.
Invoking it results in undefined behavior.
Defined at line 181 of file ../../third_party/abseil-cpp/src/absl/functional/any_invocable.h
void AnyInvocable<Sig> (std::nullptr_t )
Defined at line 182 of file ../../third_party/abseil-cpp/src/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 187 of file ../../third_party/abseil-cpp/src/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 196 of file ../../third_party/abseil-cpp/src/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 211 of file ../../third_party/abseil-cpp/src/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 223 of file ../../third_party/abseil-cpp/src/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 237 of file ../../third_party/abseil-cpp/src/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 241 of file ../../third_party/abseil-cpp/src/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 253 of file ../../third_party/abseil-cpp/src/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 265 of file ../../third_party/abseil-cpp/src/absl/functional/any_invocable.h
void ~AnyInvocable<Sig> ()
If not empty, destroys the target.
Defined at line 273 of file ../../third_party/abseil-cpp/src/absl/functional/any_invocable.h
void swap (AnyInvocable<Sig> & other)
absl::AnyInvocable::swap()
Exchanges the targets of `*this` and `other`.
Defined at line 278 of file ../../third_party/abseil-cpp/src/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 the following example, `a()` will actually
invoke `f()`, leading to an `std::bad_function_call` exception:
std::function
<void
()> f; // empty
absl::AnyInvocable
<void
()> a = f; // not empty
Invoking an empty `AnyInvocable` results in undefined behavior.
Defined at line 292 of file ../../third_party/abseil-cpp/src/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 )