#include <functional>
class event_manager
{
public:
template <typename... T>
static void register_event(const unsigned long , std::function<void(T...)> )
{
}
};
int main()
{
event_manager::register_event<unsigned int>(12, [](unsigned int ) {});
}
I2luY2x1ZGUgPGZ1bmN0aW9uYWw+CgpjbGFzcyBldmVudF9tYW5hZ2VyCnsKcHVibGljOgogICAgdGVtcGxhdGUgPHR5cGVuYW1lLi4uIFQ+CiAgICBzdGF0aWMgdm9pZCByZWdpc3Rlcl9ldmVudChjb25zdCB1bnNpZ25lZCBsb25nICwgc3RkOjpmdW5jdGlvbjx2b2lkKFQuLi4pPiApCiAgICB7CiAgICB9Cn07CgppbnQgbWFpbigpCnsKICAgIGV2ZW50X21hbmFnZXI6OnJlZ2lzdGVyX2V2ZW50PHVuc2lnbmVkIGludD4oMTIsIFtdKHVuc2lnbmVkIGludCApIHt9KTsKfQo=
prog.cpp: In function ‘int main()’:
prog.cpp:14:73: error: no matching function for call to ‘event_manager::register_event(int, main()::__lambda0)’
event_manager::register_event<unsigned int>(12, [](unsigned int ) {});
^
prog.cpp:14:73: note: candidate is:
prog.cpp:7:17: note: template<class ... T> static void event_manager::register_event(long unsigned int, std::function<void(T ...)>)
static void register_event(const unsigned long , std::function<void(T...)> )
^
prog.cpp:7:17: note: template argument deduction/substitution failed:
prog.cpp:14:73: note: ‘main()::__lambda0’ is not derived from ‘std::function<void(T ...)>’
event_manager::register_event<unsigned int>(12, [](unsigned int ) {});
^