Replies: 3 comments 2 replies
-
I think that operator overloading severely harms the clarity of most languages that have it. Given that C3 already has functions that can be called on structs using the dot (".") operator, I think that this would be a misfeature and a negative change. |
Beta Was this translation helpful? Give feedback.
-
Specialized operator overloading is sometimes very convenient and makes code far easier to read. Thinking mostly about [] overloading for vectors and maps. m["Hello"] = 5 looks nicer to write and read than m.put("Hello", 5); |
Beta Was this translation helpful? Give feedback.
-
Operator overloading is a big improvement for math libraries, especially in the gamedev fields. Similarly types such as complex numbers also benefit. v1 + (v2 - v3 * 0.5) + v4 * v5 looks better than v1.add(v2.sub(v3.mul(0.5)).add(v4.mul(v5)) Personally I don't think operator overloading goes against the C ideology. Usually C++ iostreams and boost::spirit are mentioned when it comes to operator overload abuse in other languages, but that's pretty much it. It's unusual in general to see operator overloading outside of math libraries and containers. |
Beta Was this translation helpful? Give feedback.
-
Polls testing
20 votes ·
Beta Was this translation helpful? Give feedback.
All reactions