Consider the following function:
template
void register_handler( F& f ) // any callable object
{
// find out T - the argument type of f
if F is a std::function
you should be able to use the its member type
and check with `std::is_same':
template
void register_handler( F& f ) // any callable object
{
// find out T - the argument type of f
if(std::is_same::value)
{ .... }
//etc .....
}
An up and running example here
but that kind of code can quickly become a mess to maintain.