Further consideration of this issue . Assuming that placeholder can be used to output the result type of the function pointer that makes up the non-piggy template parameter. Does C ++ 17 allow overload resolution when passing the name of a template function - without knowing the type of result that is needed to perform implicit casting?
template <auto(*)(int)>
struct Foo { };
int bar(int);
float bar(float);
int main() {
static_cast<void>(Foo<bar>{});
}
[gcc] as well as [clang] seem to be accepting the code.
source
share