Member and nonmember functions with the same name do not overload one another.
具有同一名字的成员函数和非成员函数不会相互重载。
Most operators may be defined as member or nonmember functions.
大多数操作符可以定义为成员函数或非成员函数。
It defines one member operator and has three nonmember operators.
它定义了一个成员操作符,并且有三个非成员操作符。
Most overloaded operators may be defined as ordinary nonmember functions or as class member functions.
大多数重载操作符可以定义为普通非成员函数或类的成员函数。
The fact that member and nonmember functions are possible changes how the set of candidate functions is selected.
成员函数和非成员函数都是可能的,这一事实改变了选择候选函数集的方式。
When resolving the use of an operator, it is possible for both nonmember and member versions of the operator to be candidates.
而确定操作符的使用时,操作符的非成员和成员版本可能都是候选者。
Symmetric operators, such as the arithmetic, equality, relational, and bitwise operators, are best defined as ordinary nonmember functions.
对称的操作符,如算术操作符、相等操作符、关系操作符和位操作符,最好定义为普通非成员函数。
Symmetric operators, such as the arithmetic, equality, relational, and bitwise operators, are best defined as ordinary nonmember functions.
对称的操作符,如算术操作符、相等操作符、关系操作符和位操作符,最好定义为普通非成员函数。
应用推荐