> additionally, overloaded operators in libraries intended for reuse should usually have equivalent text-named functions/methods, for when the library is used in contexts where using the overloaded operators would be confusing.
Ok, but in that case you need two systems to access the same code, that only adds to the confusion and really negates all upside from having the overloaded operator in the first place.
That violates DRY in a very ugly way.
Anyway, I think we can agree on one thing: operator overloading is something that one should not do just because it is possible, but only for very good reasons.
I don't think aliasing (or the moral equivalent, where operator vs. method/function can't be an alias from an implementation point of view) violates DRY. Presenting an alternative API for different use cases isn't repetition.
> Anyway, I think we can agree on one thing: operator overloading is something that one should not do just because it is possible, but only for very good reasons.
Ok, but in that case you need two systems to access the same code, that only adds to the confusion and really negates all upside from having the overloaded operator in the first place.
That violates DRY in a very ugly way.
Anyway, I think we can agree on one thing: operator overloading is something that one should not do just because it is possible, but only for very good reasons.
Does that work?