我正在为这样的类重载小于运算符:
#include<string>
using namespace std;
class X{
public:
    X(long a, string b, int c);
    friend bool operator< (X& a, X& b);
private:
    long a;
    string b;
    int c;
};
然后是实现文件:
#include "X.h"
bool operator < (X const& lhs, X const& rhs)
{
    return lhs.a< rhs.a;
}
但是它不允许我访问a实现文件中的数据成员,因为a它被声明为私有数据成员,即使它是通过X对象?