[PATCH] Add minnum / maxnum to APFloat

Chandler Carruth chandlerc at gmail.com
Thu Oct 9 19:42:10 PDT 2014

Comment at: include/llvm/ADT/APFloat.h:339-341
@@ -338,2 +338,5 @@
+  const APFloat &minnum(const APFloat &) const;
+  const APFloat &maxnum(const APFloat &) const;
   /// @}
I think these should be free functions. I know that breaks with historical patterns here, but we should start moving the API in that direction IMO (and others I've chatted about this API with seemed to agree).

As part of that, this needs to return by-value. As-is, this can return a dangling reference to a temporary argument.


More information about the llvm-commits mailing list