[libcxx-commits] [PATCH] D60097: Fix implementation of ::abs and std::abs LWG 2192.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 2 09:41:49 PDT 2019


ldionne added a comment.

> Suggestions for a cleaner implementation are welcome.

Why don't we move `abs` to a third header, say `__abs.h`, and then include that from both `math.h` and `stdlib.h`?



================
Comment at: include/math.h:800
+inline _LIBCPP_INLINE_VISIBILITY float abs(float __lcpp_x) _NOEXCEPT {
+  return __builtin_fabsf(__lcpp_x);
+}
----------------
We were not using the builtin before -- why the change?


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

https://reviews.llvm.org/D60097





More information about the libcxx-commits mailing list