struct setup_entry
{
template< typename T >
void Disable( bool(*p)(T*) ) { ... }
}
Calling Disable:
setup_entry X;
Case 1: X.Disable( [](int*)->bool{...} ); //FAIL to deduce T
Case 2: X.Disable<int>( [](int*)->bool{...} ); //OK to deduce T
I would like to use case 1. (Easier for the user)
Any ideas?
The simplified final solution for the record was to do this:
template< typename T >
void Disable( T&& Callback )
{
auto p = +Callback;
...
}