#include <iostream>
#include <string>
using namespace std;
//函数模板
template <typename T>
int compare(const T&t1, const T&t2)
{
if (t1 > t2) return 1;
if (t1 < t2)return -1;
return 0;
}
class Stu
{
};
int main()
{
string s1 = "abc";
string s2 = "hello";
int rv = compare(s1,s2);
#if 0
//传递指针时,比较的是指针的值0x002ddafc,而不是指向的字符串
char *p = "hhhh";
char *q = "fffff";
rv = compare(p, q);
#endif
return 0;
}