fork download
  1. struct A{};
  2.  
  3. struct B{
  4. template<class T = A>
  5. void foo(){}
  6. };
  7.  
  8. int main()
  9. {
  10. B b;
  11. b.foo();
  12. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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()’
stdout

Standard output is empty