Give detail functions in ConstexprMath.h decorated names
authorYedidya Feldblum <yfeldblum@fb.com>
Sun, 31 Dec 2017 00:08:31 +0000 (16:08 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 31 Dec 2017 00:25:31 +0000 (16:25 -0800)
Summary:
[Folly] Give detail functions in `ConstexprMath.h` decorated names.

So that other code also in `namespace folly::detail` which invokes the non-detail functions will result in ambiguity.

Reviewed By: spalamarchuk

Differential Revision: D6646313

fbshipit-source-id: 679e4cfe1c90f494acacef8b2a38a453db4d79d5

folly/ConstexprMath.h

index 34f7664e2c1cfc4fa21009573e0fe88f4fdd4b3f..a15f098c5421b3d13168529ab1f7822276185b58 100644 (file)
@@ -105,24 +105,24 @@ constexpr auto constexpr_abs(T t)
 
 namespace detail {
 template <typename T>
-constexpr T constexpr_log2(T a, T e) {
-  return e == T(1) ? a : constexpr_log2(a + T(1), e / T(2));
+constexpr T constexpr_log2_(T a, T e) {
+  return e == T(1) ? a : constexpr_log2_(a + T(1), e / T(2));
 }
 
 template <typename T>
-constexpr T constexpr_log2_ceil(T l2, T t) {
+constexpr T constexpr_log2_ceil_(T l2, T t) {
   return l2 + T(T(1) << l2 < t ? 1 : 0);
 }
 } // namespace detail
 
 template <typename T>
 constexpr T constexpr_log2(T t) {
-  return detail::constexpr_log2(T(0), t);
+  return detail::constexpr_log2_(T(0), t);
 }
 
 template <typename T>
 constexpr T constexpr_log2_ceil(T t) {
-  return detail::constexpr_log2_ceil(constexpr_log2(t), t);
+  return detail::constexpr_log2_ceil_(constexpr_log2(t), t);
 }
 
 template <typename T>