31 lines · c
1#ifndef TEMPLATE_CLASS_TEST_H // comment 12#define TEMPLATE_CLASS_TEST_H3 4template <typename T>5class A {6 public:7 void f();8 void g();9 template <typename U> void h();10 template <typename U> void k();11 static int b;12 static int c;13};14 15template <typename T>16void A<T>::f() {}17 18template <typename T>19template <typename U>20void A<T>::h() {}21 22template <typename T>23int A<T>::b = 2;24 25class B {26 public:27 void f();28};29 30#endif // TEMPLATE_CLASS_TEST_H31