无意中在网上看到一段程序,感觉比较变态。
#include "stdafx.h"
#include <iostream>
#include <vector>
typedef int UINT4;
using namespace std;
class Hack
{
int m_a;
int m_b;
};
Hack& operator< (Hack &a , Hack &b)
{
std::cerr << "小于操作符/n";
return a;
}
Hack& operator> (Hack &a, Hack &b)
{
std::cerr << "大于操作符/n";
return a;
}
int _tmain(int argc, _TCHAR* argv[])
{
Hack vector;
Hack UINT4;
Hack foo;
vector<UINT4> foo;
system("pause");
return 0;
}
输出结果 看看吧。