diff --git a/libs/ecs/include/psemek/ecs/handle.hpp b/libs/ecs/include/psemek/ecs/handle.hpp index ef2c054d..2066ad01 100644 --- a/libs/ecs/include/psemek/ecs/handle.hpp +++ b/libs/ecs/include/psemek/ecs/handle.hpp @@ -3,6 +3,7 @@ #include #include +#include namespace psemek::ecs { @@ -46,4 +47,18 @@ namespace std } }; + template + struct formatter<::psemek::ecs::handle, Char> + { + constexpr auto parse(std::format_parse_context & ctx) + { + return ctx.begin(); + } + + auto format(::psemek::ecs::handle const & handle, std::format_context & ctx) const + { + return std::format_to(ctx.out(), "({},{})", handle.id, handle.epoch); + } + }; + }