# C++中的private：类型相同的两个对象，是否可以访问对方的private成员？

class Point{
public:
Point(Point & p);
private:
int x;
}
Point::Point(Point & p){
x = p.x;
}


Point::Point(Point & p)函数体中的语句“x = p.x”，为什么可以正常编译？

A member of a class can be
— private; that is, its name can be used only by members and friends of the class in which it is declared.
— protected; that is, its name can be used only by members and friends of the class in which it is declared, and by members and friends of classes derived from this class (see 11.5).
— public; that is, its name can be used anywhere without access restriction.

1. 从实现的角度看：

2.从封装的角度看：