大多数操作符可以定义为成员函数或非成员函数。
Most operators may be defined as member or nonmember functions.
具有同一名字的成员函数和非成员函数不会相互重载。
Member and nonmember functions with the same name do not overload one another.
最后,让我们来看看如何使用非成员函数的影响对象耦合。
Finally, let's see how the use of non-member functions affects object coupling.
我如何能在非成员函数使用私有成员变量时,变量是指针?
How can I use a private member variable in a non-member function, when the variable happens to be a pointer?
大多数重载操作符可以定义为普通非成员函数或类的成员函数。
Most overloaded operators may be defined as ordinary nonmember functions or as class member functions.
但是,也有情况下,当一个非成员函数足以成为一个中间人的角色。
However, there are cases when a non-member function is enough to serve the role of a mediator.
成员函数和非成员函数都是可能的,这一事实改变了选择候选函数集的方式。
The fact that member and nonmember functions are possible changes how the set of candidate functions is selected.
对称的操作符,如算术操作符、相等操作符、关系操作符和位操作符,最好定义为普通非成员函数。
Symmetric operators, such as the arithmetic, equality, relational, and bitwise operators, are best defined as ordinary nonmember functions.
pathoperator / (char*lhs,const path&rhs):此例程是 path的非成员函数。
path operator / (char* lhs, const path& rhs): This routine is a non-member function of path.
在第一种情况下,你基本上是声明一个私有拷贝构造函数,然后没有提供任何实现。通过声明他们私人,非成员国不能复制它。
In the first case, you are essentially declaring a private copy constructor and then not providing any implementation. By declaring them private, non-members cannot copy it.
在第一种情况下,你基本上是声明一个私有拷贝构造函数,然后没有提供任何实现。通过声明他们私人,非成员国不能复制它。
In the first case, you are essentially declaring a private copy constructor and then not providing any implementation. By declaring them private, non-members cannot copy it.
应用推荐