template<typename Ret, bool Fixed, size_t MaxBinds = 16, typename... Args>
MultiCallback struct

Multi-binding delegate — dispatches to MaxBinds simultaneous listeners.

Template parameters
Ret Return type (typically void for multicast use).
Fixed true for fixed-size in-place storage, false for dynamic.
MaxBinds Capacity (Fixed) or growth increment (dynamic).
Args Argument types forwarded to all bindings on invocation.

Two storage strategies selected at compile time:

  • Fixed=true — bindings stored in a std::array; trivially copyable, no heap.
  • Fixed=false — bindings stored in a std::vector; grows dynamically.

Public types

using CB = Callback<Ret, Args...>

Constructors, destructors, conversion operators

__attribute__((always_inline)) const
Invoke all bound listeners in registration order.

Public functions

template<typename T, Ret(T::*)(Args...) MemFn>
void Bind(T* obj)
Bind a member function to the next available slot.
void BindStatic(typename CB::Fn fn, void* ctx = nullptr)
Bind a free function or thunk to the next available slot.
template<typename T, Ret(T::*)(Args...) MemFn>
void Unbind(T* obj)
Remove the first binding that matches obj and MemFn.
void UnbindStatic(typename CB::Fn fn, void* ctx = nullptr)
Remove the first static binding that matches fn and ctx.
void UnbindByContext(void* ctx)
Remove all bindings whose context pointer equals ctx.
void Reset()
Clear all bindings.
auto IsBound() const -> bool
Returns true if at least one slot is currently bound.

Public variables

MultiCallbackStorage<CB, Fixed, MaxBinds> Bindings

Function documentation

template<typename Ret, bool Fixed, size_t MaxBinds, typename... Args> template<typename T, Ret(T::*)(Args...) MemFn>
void MultiCallback<Ret, Fixed, MaxBinds, Args>::Bind(T* obj)

Bind a member function to the next available slot.

template<typename Ret, bool Fixed, size_t MaxBinds, typename... Args>
void MultiCallback<Ret, Fixed, MaxBinds, Args>::BindStatic(typename CB::Fn fn, void* ctx = nullptr)

Bind a free function or thunk to the next available slot.

template<typename Ret, bool Fixed, size_t MaxBinds, typename... Args>
void MultiCallback<Ret, Fixed, MaxBinds, Args>::UnbindByContext(void* ctx)

Remove all bindings whose context pointer equals ctx.