| ▲ | pron 2 days ago | |||||||
I'm not disputing that some people like user-controlled operator overloading (Zig does have + etc. for vectors), but clearly others prefer no user-controlled overloading of any kind (don't know what the LLMs prefer, if they have any preferences at all). In the safety-critical space where I once worked, where people could get hurt or die if there's a stack overflow, the more common preference was against (user-controlled) overloads or any implicitness. That's why we need options. | ||||||||
| ▲ | dnautics 2 days ago | parent | next [-] | |||||||
I think zig would do to have "custom binary operators" which is not operator overloading, but basically give people what they want. It would suffice to be syntactic sugar elaborated by the parser. For example: | ||||||||
| ||||||||
| ▲ | clhodapp 2 days ago | parent | prev [-] | |||||||
Fair, but don't conflate custom operators with overloading just because C++ happened to have one very specific way of implementing custom operators. | ||||||||
| ||||||||