cxx-templates.h revision b24e199fbd17af780ab000c5862d191e4daffc0f
1// Header for PCH test cxx-templates.cpp 2 3template <typename T1, typename T2> 4struct S { 5 static void templ(); 6}; 7 8template <typename T> 9struct S<int, T> { 10 static void partial(); 11}; 12 13template <> 14struct S<int, float> { 15 static void explicit_special(); 16}; 17 18template <typename T, int y> 19T templ_f(T x) { 20 return x+y; 21} 22 23void govl(int); 24void govl(char); 25 26template <typename T> 27struct Unresolv { 28 void f() { 29 govl(T()); 30 } 31}; 32 33template <typename T> 34struct Dep { 35 typedef typename T::type Ty; 36 void f() { 37 Ty x = Ty(); 38 T::my_f(); 39 int y = T::template my_templf<int>(0); 40 ovl(y); 41 } 42 43 void ovl(int); 44 void ovl(float); 45}; 46 47template<typename T, typename A1> 48inline T make_a(const A1& a1) { 49 return T(a1); 50} 51