I am trying to pass a templated function to another, like this:
template<typename T = bool>
void fun() {}
template<typename F>
void higher_order_fun( const F & f) {
f();
}
int main () {
//higher_order_fun(fun<>); //works
higher_order_fun(fun);
}
In gcc10.2 I am able to pass fun (a template prototype) in the same way
as the specified type fun<>.
Note that this does not work if I don't have the default template parameter T=bool.
In Clang11 this doesn't work.
See https://godbolt.org/z/9WfMdc.
What is going on here?