#include #include using namespace SDL2pp::Private; void EventHandlerFunction(SDL_Event); struct EventHandlerFunctor { void operator()(SDL_Event); }; struct EventHandler { void HandleEvent(SDL_Event); }; struct InvalidEventHandler { void handleEvent(SDL_Event); }; int main(int, char*[]) { auto lambda = [](SDL_Event) { }; // Test IsEventHandlerFunctor static_assert( IsEventHandlerFunctor::value, "IsEventHandlerFunctor<> should accept functions like void(SDL_Event)" ); static_assert( IsEventHandlerFunctor::value, "IsEventHandlerFunctor<> should accept functions like void(SDL_Event)" ); static_assert( IsEventHandlerFunctor::value, "IsEventHandlerFunctor<> shouldn accept a class with operator(SDL_Event)" ); // Test IsEventHandlerObject static_assert( IsEventHandlerObject::value, "IsEventHandlerObject<> should accept a class with HandleEvent(SDL_Event)" ); static_assert( !IsEventHandlerObject::value, "IsEventHandlerObject<> shouldn't accept a class without a valid signature" ); // Test IsEventHandler static_assert( IsEventHandler::value, "IsEventHandler<> should accept functions like void(SDL_Event)" ); static_assert( IsEventHandler::value, "IsEventHandler<> should accept functions like void(SDL_Event)" ); static_assert( IsEventHandler::value, "IsEventHandler<> should accept a class with operator(SDL_Event)" ); static_assert( IsEventHandler::value, "IsEventHandler<> should accept a class with HandleEvent(SDL_Event)" ); static_assert( !IsEventHandler::value, "IsEventHandler<> shouldn't accept a class without a valid signature" ); return 0; }