background image

  int* p1 = &i1;
 
  int* p2 = &i2;
 
  bool r4 = Compare<int*>::IsEqual(p1, p2);
 
  // vector<T>
 
  vector<int> v1;
 
  v1.push_back(1);
 
  v1.push_back(2);
 
  vector<int> v2;
 
  v2.push_back(1);
 
  v2.push_back(2);
 
  bool r5 = Compare<vector<int> >::IsEqual(v1, v2);
 
  // custom template class
 
  SpecializedType<float> s1 = {10.1f,10.2f};
 
  SpecializedType<float> s2 = {10.3f,10.0f};
 
  bool r6 = Compare<SpecializedType<float> >::IsEqual(s1, s2);

转载自:http://www.sz-isp.com http://www.szgreatwall.net http://www.ip80.net
 
  public:
 
  static bool IsEqual(const T& lh, const T& rh)
 
  {
 
  return lh == rh;
 
  }
 
  };