diff options
Diffstat (limited to 'core/async_event.h')
-rw-r--r-- | core/async_event.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/async_event.h b/core/async_event.h index 9e2d1193..c049fa02 100644 --- a/core/async_event.h +++ b/core/async_event.h @@ -54,7 +54,11 @@ using AsyncEvent = std::variant<AsyncKillThread, AsyncDisconnectEvent>; template<typename T, typename ...Args> -auto &InitAsyncEvent(AsyncEvent *evt, Args&& ...args) -{ return std::get<T>(*al::construct_at(evt, std::in_place_type<T>, std::forward<Args>(args)...)); } +auto &InitAsyncEvent(std::byte *evtbuf, Args&& ...args) +{ + auto *evt = al::construct_at(reinterpret_cast<AsyncEvent*>(evtbuf), std::in_place_type<T>, + std::forward<Args>(args)...); + return std::get<T>(*evt); +} #endif |