请高人解答:容器类对象大小的比较——小弟我自己写的类,如何就出错了

请高人解答:容器类对象大小的比较——我自己写的类,怎么就出错了?
#include <vector>
using namespace std;
using std::vector;
#include <stdio.h> 

class A
{
int i;
public:
A(){i=0;};
A(int j){i=j;}
bool operator > (const A &a2);//重载>
bool operator < (const A &a2);//重载<
bool operator == (const A &a2);//重载==
bool operator != (const A &a2);//重载!=
};
bool A::operator> (const A &a2)//重载>
{
return (i > a2.i)?true:false;
}
bool A::operator< (const A &a2)//重载<
{
return !(*this > a2);
}
bool A::operator== (const A &a2)//重载==
{
return (i == a2.i)?true:false;
}
bool A::operator!= (const A &a2)//重载!=
{
return !(*this == a2);
}


void main()
{
A a(1);
vector<int>::size_type iLength=5;//将iLength赋值为5
vector<A> iv1(iLength,a);//定义一个容器。用iLength个a来初始化。
A b(2);
vector<A> iv2(iLength,b);//定义一个容器。用iLength个b来初始化。

if(iv1 > iv2)
{
printf("iv1 > iv2\n");
}
if(iv1 < iv2)
{
printf("iv1 < iv2\n");
}
if(iv1 == iv2)
{
printf("iv1 == iv2\n");
}
if(iv1 != iv2)
{
printf("iv1 != iv2\n");
}
}

我觉得上面的程序没什么问题,为什么编译失败?
在vs2008+win7系统下:
报错:error C2678: 二进制“<”: 没有找到接受“const A”类型的左操作数的运算符(或没有可接受的转换)

谁能解答正确?请高人帮忙

------解决方案--------------------
探讨

引用:
语法上哪里悟去?当然是语法书上看来的了。


请问是什么书

------解决方案--------------------
探讨
引用:
语法上哪里悟去?当然是语法书上看来的了。


请问是什么书