#include <iostream>
using namespace std;
//template<typename T> T f(T x = T() ) { return x; }
template<typename T> T f( T x) { return x; }
template<typename T> T f()
{
return f<T>(T());
}
int main() {
auto a = f();
std::cout << a;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKLy90ZW1wbGF0ZTx0eXBlbmFtZSBUPiBUIGYoVCB4ID0gVCgpICkgeyByZXR1cm4geDsgfQoKdGVtcGxhdGU8dHlwZW5hbWUgVD4gVCBmKCBUIHgpIHsgcmV0dXJuIHg7IH0KCnRlbXBsYXRlPHR5cGVuYW1lIFQ+IFQgZigpCnsKICByZXR1cm4gZjxUPihUKCkpOwp9CgppbnQgbWFpbigpIHsKCQoJYXV0byBhID0gZigpOwoJc3RkOjpjb3V0IDw8IGE7CglyZXR1cm4gMDsKfQo=
prog.cpp: In function 'int main()':
prog.cpp:15:13: error: no matching function for call to 'f()'
auto a = f();
^
prog.cpp:6:24: note: candidate: template<class T> T f(T)
template<typename T> T f( T x) { return x; }
^
prog.cpp:6:24: note: template argument deduction/substitution failed:
prog.cpp:15:13: note: candidate expects 1 argument, 0 provided
auto a = f();
^
prog.cpp:8:24: note: candidate: template<class T> T f()
template<typename T> T f()
^
prog.cpp:8:24: note: template argument deduction/substitution failed:
prog.cpp:15:13: note: couldn't deduce template parameter 'T'
auto a = f();
^