If you need several Fun functions for different Callable s, then static_assert() will not help you, but you can use SFINAE, for example
// version for int(double,double) template<typename Callable> auto Fun(Callable c) -> typename std::enable_if<std::is_same<decltype(c(0.0,0.0)),int>::value>::type { /* ... */ } // version for int(double,double,double) template<typename Callable> auto Fun(Callable c) -> typename std::enable_if<std::is_same<decltype(c(0.0,0.0,0.0)),int>::value>::type { /* ... */ }
source share