fork download
  1. #include <stdio.h>
  2.  
  3. class A
  4. {
  5. public:
  6. template< class T > void Func( void ){}
  7. };
  8.  
  9. template< class T >
  10. class B
  11. {
  12. public:
  13. void FuncB( T* p )
  14. {
  15. /* error
  16.   p->Func<B>();
  17.   */
  18. p->template Func<B>();
  19. }
  20. };
  21.  
  22. int main( void )
  23. {
  24. A a;
  25. B<A> b;
  26. b.FuncB(&a);
  27. return 0;
  28. }
Success #stdin #stdout 0.01s 2676KB
stdin
Standard input is empty
stdout
Standard output is empty