Index: source/network/FSM.h =================================================================== --- source/network/FSM.h +++ source/network/FSM.h @@ -170,10 +170,12 @@ { size_t operator()(const TransitionKey& key) const noexcept { - static_assert(sizeof(UnderlyingType) <= sizeof(size_t) / 2); - return (static_cast(key.state) << - ((sizeof(size_t) / 2) * std::numeric_limits::digits)) + - static_cast(key.eventType); + constexpr size_t count{(sizeof(size_t) / 2) * + std::numeric_limits::digits}; + + const size_t wideState{static_cast(key.state)}; + return static_cast(key.eventType) ^ + (wideState << count) ^ (wideState >> count); } };