运算符重载的基本规则和惯用法是什么?

丶灬走出姿态 提交于 2020-08-18 04:46:51

问题:

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: 注意:答案是按特定顺序给出的,但是由于许多用户是根据投票而不是给出时间来对答案进行排序的,因此以下是最有意义的顺序索引

(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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!