AnyDelegate class
A type-erased delegate that can store either a Delegate or a LambdaDelegate without heap allocations.
Base classes
-
template<typename Interface, typename AnyClass, size_class AnyDelegateImpl<IDelegate, AnyDelegate, sizeof(Delegate<detail::DummyClassForDelegate>)>
t StorageSize>
Public types
- class UnbindDummy
- using Base = AnyDelegateImpl
Constructors, destructors, conversion operators
- operator bool() const explicit
- Checks if a non-dummy function is stored.
Public functions
- auto operator()(Args && ... args) -> auto
- Calls the stored function.
- auto operator()(Args && ... args) const -> auto
- Calls the stored function.
- auto getDelegate() -> IDelegate*
- auto getDelegate() const -> const IDelegate*
Protected types
- using Interface_ = IDelegate