[PATCH] D75511: [APFloat] Remove neg in favour of unary operator-

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 08:53:00 PST 2020


sepavloff added a comment.

In D75511#1903158 <https://reviews.llvm.org/D75511#1903158>, @foad wrote:

> In D75511#1902991 <https://reviews.llvm.org/D75511#1902991>, @ekatz wrote:
>
> > 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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75511/new/

https://reviews.llvm.org/D75511





More information about the llvm-commits mailing list