Helios Engine 0.1.0
A modular ECS based data-oriented C++23 game engine
 
Loading...
Searching...
No Matches
helios::ecs::EventTrait Concept Reference

Concept for valid event types. More...

#include <event.hpp>

Concept definition

template<typename T>
concept helios::ecs::EventTrait = std::move_constructible<T> && std::is_move_assignable_v<T> && std::is_trivially_copyable_v<T>
Concept for valid event types.
Definition event.hpp:44

Detailed Description

Concept for valid event types.

A valid event must be:

  • Move constructible
  • Move assignable
  • Trivially copyable (required for safe storage in byte buffers)
Note
Events are stored as raw bytes using memcpy, so they must be trivially copyable. This means events cannot contain:
  • std::string, std::vector, or other types with dynamic allocation
  • Virtual functions
  • User-defined copy/move constructors/assignment operators

Use fixed-size arrays (e.g., char[N]) instead of dynamic containers.

Definition at line 44 of file event.hpp.