From: Yedidya Feldblum Date: Sun, 31 Dec 2017 00:08:31 +0000 (-0800) Subject: Give detail functions in ConstexprMath.h decorated names X-Git-Tag: v2018.01.01.00~1 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=4753aa16c88d615936a0d9b035d18ed2b2c804bc;p=folly.git Give detail functions in ConstexprMath.h decorated names 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 --- diff --git a/folly/ConstexprMath.h b/folly/ConstexprMath.h index 34f7664e..a15f098c 100644 --- a/folly/ConstexprMath.h +++ b/folly/ConstexprMath.h @@ -105,24 +105,24 @@ constexpr auto constexpr_abs(T t) namespace detail { template -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 -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 constexpr T constexpr_log2(T t) { - return detail::constexpr_log2(T(0), t); + return detail::constexpr_log2_(T(0), t); } template 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