1 2 3 4 5 6 7 8 9 10 11 12 | struct A{}; struct B{ template<class T = A> void foo(){} }; int main() { B b; b.foo(); } |
c3RydWN0IEF7fTsKCnN0cnVjdCBCewogdGVtcGxhdGU8Y2xhc3MgVCA9IEE+CiB2b2lkIGZvbygpe30KfTsKCmludCBtYWluKCkKewogICBCIGI7CiAgIGIuZm9vKCk7Cn0=
prog.cpp:5: error: default template arguments may not be used in function templates prog.cpp: In function ‘int main()’: prog.cpp:11: error: no matching function for call to ‘B::foo()’
-
result: Compilation error (maybe you wish to see an example for C++ 4.7.2)


