#include <type_traits>
template <typename T, typename std::enable_if<std::is_floating_point<T>{} || std::is_integral<T>{}, T>::type * = nullptr>
void fn(T a, T b)
{
}
struct Foo {};
int main(int, const char **)
{
//fn<Foo>(Foo{}, Foo{});
fn<Foo, void>(Foo{}, Foo{});
return 0;
}
I2luY2x1ZGUgPHR5cGVfdHJhaXRzPgoKdGVtcGxhdGUgPHR5cGVuYW1lIFQsIHR5cGVuYW1lIHN0ZDo6ZW5hYmxlX2lmPHN0ZDo6aXNfZmxvYXRpbmdfcG9pbnQ8VD57fSB8fCBzdGQ6OmlzX2ludGVncmFsPFQ+e30sIFQ+Ojp0eXBlICogPSBudWxscHRyPgp2b2lkIGZuKFQgYSwgVCBiKQp7Cn0KCnN0cnVjdCBGb28ge307CgppbnQgbWFpbihpbnQsIGNvbnN0IGNoYXIgKiopCnsKCS8vZm48Rm9vPihGb297fSwgRm9ve30pOwoJZm48Rm9vLCB2b2lkPihGb297fSwgRm9ve30pOwoJcmV0dXJuIDA7Cn0=
prog.cpp: In function ‘int main(int, const char**)’:
prog.cpp:13:28: error: no matching function for call to ‘fn(Foo, Foo)’
fn<Foo, void>(Foo{}, Foo{});
^
prog.cpp:4:6: note: candidate: template<class T, typename std::enable_if<(std::is_floating_point<_Tp>{} || std::is_integral<_Tp>{}), T>::type* <anonymous> > void fn(T, T)
void fn(T a, T b)
^~
prog.cpp:4:6: note: template argument deduction/substitution failed: