fork download
  1.  
  2.  
  3. template<typename Base>
  4. struct A
  5. {
  6. template<typename T> void createItem() {}
  7. };
  8.  
  9.  
  10. template<typename Base>
  11. struct B : A<Base>
  12. {
  13. template<typename T> void obtainItem() { this->createItem<T>(); }
  14. };
  15.  
  16.  
  17. int main()
  18. {
  19. B<char> b;
  20. b.obtainItem<int>();
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In member function 'void B<Base>::obtainItem()':
prog.cpp:13:64: error: expected primary-expression before '>' token
prog.cpp:13:66: error: expected primary-expression before ')' token
stdout
Standard output is empty