Operators
operator overloading
当运算符 overload as member funcitons 时, 左侧的操作数应是调用对象;当overload as non-member funcitons 时,运算符左侧的操作数对应于运算符函数的第一个参数,运算符表达式右侧的操作数对应于运算符函数的第二个参数。
友元函数是在类声明中声明的,但它不是成员函数,因此不能使用成员运算符来调用。
how does C++ know how to apply operators to user-defined classes?
const object can only call const functions
return type with const -> can't be assigned(changed) as lvalue
for a const variable you have to do them(declare, initialize) simutaneously
canonical forms
POLA(principle of least astonishment