Zelda64Recomp/ultramodern/utils.hpp

12 lines
250 B
C++
Raw Normal View History

2024-05-15 16:35:14 +00:00
#include <variant>
template<class... Ts>
struct overloaded : Ts...
{
using Ts::operator()...;
};
template<class T, class... Ts>
auto match(const T& event, Ts&&... args){
return std::visit(overloaded{std::forward<Ts>(args)...}, event);
}