问题:
Note: The answers were given in a specific order , but since many users sort answers according to votes, rather than the time they were given, here's an index of the answers in the order in which they make most sense: 注意:答案是按特定顺序给出的,但是由于许多用户是根据投票而不是给出时间来对答案进行排序的,因此以下是最有意义的顺序索引 :
- The General Syntax of operator overloading in C++ C ++中运算符重载的通用语法
- The Three Basic Rules of Operator Overloading in C++ C ++中运算符重载的三个基本规则
- The Decision between Member and Non-member 会员与非会员之间的决定
- Common operators to overload 普通运算符重载
- Assignment Operator 赋值运算符
- Input and Output Operators 输入和输出运算符
- Function call operator 函数调用运算符
- Comparison operators 比较运算符
- Arithmetic Operators 算术运算符
- Array Subscripting 数组下标
- Operators for Pointer-like Types 指针类型的运算符
- Conversion Operators 转换运算符
- Overloading new and delete 重载新的和删除的
(Note: This is meant to be an entry to Stack Overflow's C++ FAQ . If you want to critique the idea of providing an FAQ in this form, then the posting on meta that started all this would be the place to do that. Answers to that question are monitored in the C++ chatroom , where the FAQ idea started out in the first place, so your answer is very likely to get read by those who came up with the idea.) (注意:这本来是Stack Overflow的C ++ FAQ的条目。如果您想批评以这种形式提供FAQ的想法,那么在所有这些都开始的meta上的张贴将是这样做的地方。该问题在C ++聊天室中进行监控,该问题最初是从FAQ想法开始的,所以提出这个想法的人很可能会读懂您的答案。)
解决方案:
参考一: https://stackoom.com/question/IYHq/运算符重载的基本规则和惯用法是什么参考二: https://oldbug.net/q/IYHq/What-are-the-basic-rules-and-idioms-for-operator-overloading
来源:oschina
链接:https://my.oschina.net/u/3797416/blog/4298690