Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This is a simple change, so generally it looks good, but I have to ask:
What is the reason for it? I do understand why you want to add functionality (the operator- in the other change), but I am not sure why to remove.
Just the general principle of cleaning up after yourself. I think it's silly to have two different names for a simple negation function. If you only ever add functionality, and never remove the old obsoleted functionality, you'll end up with a lot of useless old cruft in your codebase.
Some C++ programming styles discourage using overloaded operators, because functions express programmer's intentions clearer.
Sure, but I don't see anything in the LLVM Programmer’s Manual or LLVM Coding Standards that discourages it. And I think overloading arithmetic operators for a numeric type is the sanest possible use of overloading.
It is a matter of taste. I actually see the benefits of the clear code when using operator overloads.
The question is, should we remove the explicit function calls?
Lets say we do; I still prefer (above all) a unified coding style. In this case, it interprets as: removing all the other operators. The problem is, with add (for example). It receives a roundingMode as a parameter, which means that we can't remove this function, in exchange to the operator+. We must maintain both.
So, to maintain consistency, I think we should keep neg as well.