What makes Scala's operator overloading “good”, but C++'s “bad”?

后端 未结 14 2100
悲哀的现实
悲哀的现实 2020-12-12 11:20

Operator overloading in C++ is considered by many to be A Bad Thing(tm), and a mistake not to be repeated in newer languages. Certainly, it was one feature specifically drop

14条回答
  •  情深已故
    2020-12-12 12:06

    Operator overloading in C++ is considered by many to be A Bad Thing(tm)

    Only by the ignorant. It is absolutely required in a language like C++, and it is noticeable that other languages that started off taking a "purist" view, have added it once their designers found out how necessary it is.

提交回复
热议问题