1 #include <stdio.h> 2 3 template <class T> class A 4 { 5 public: 6 void accessMember(T a); 7 T accessMemberConst() const; 8 static int accessStaticMember(); 9 accessMemberInline(T a)10 void accessMemberInline(T a) __attribute__ ((always_inline)) 11 { 12 m_a = a; // breakpoint 4 13 } 14 15 T m_a; 16 static int s_a; 17 }; 18 19 template <class T> int A<T>::s_a = 5; 20 accessMember(T a)21template <class T> void A<T>::accessMember(T a) 22 { 23 m_a = a; // breakpoint 1 24 } 25 accessMemberConst() const26template <class T> T A<T>::accessMemberConst() const 27 { 28 return m_a; // breakpoint 2 29 } 30 accessStaticMember()31template <class T> int A<T>::accessStaticMember() 32 { 33 return s_a; // breakpoint 3 34 } 35 main()36int main() 37 { 38 A<int> my_a; 39 40 my_a.accessMember(3); 41 my_a.accessMemberConst(); 42 A<int>::accessStaticMember(); 43 my_a.accessMemberInline(5); 44 } 45