#pragma once #include "../meta/meta.hpp" namespace geode::core { namespace impl { /* the handler itself */ template Ret handler(Args... args) { static thread_local int counter = 0; if constexpr (std::is_same_v) { if (counter == (int)Det->size()) counter = 0; Det->at(counter++)(args...); if (--counter < 0) counter = Det->size() - 1; } else { if (counter == (int)Det->size()) counter = 0; Ret ret = Det->at(counter++)(args...); if (--counter < 0) counter = Det->size() - 1; return ret; } } template