diff options
author | 2015-12-08 16:19:20 +0000 | |
---|---|---|
committer | 2015-12-08 16:19:20 +0000 | |
commit | 2433d4e17c3006b8262a0d9421e201fc84777208 (patch) | |
tree | 06924f7e4b7f14db21fe41ec03a6b95eec29efeb /runtime/base/bit_utils.h | |
parent | 74af075f11e23918edc25c86fb2f1d8209cf94fc (diff) | |
parent | e0d25b156ef12b23afa2a6493ae703ec82e23475 (diff) |
Merge "Allow initializing runtime with parsed options."
am: e0d25b156e
* commit 'e0d25b156ef12b23afa2a6493ae703ec82e23475':
Allow initializing runtime with parsed options.
Diffstat (limited to 'runtime/base/bit_utils.h')
-rw-r--r-- | runtime/base/bit_utils.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/base/bit_utils.h b/runtime/base/bit_utils.h index d6a44f7293..8430d68d0e 100644 --- a/runtime/base/bit_utils.h +++ b/runtime/base/bit_utils.h @@ -23,6 +23,7 @@ #include "base/logging.h" #include "base/iteration_range.h" +#include "base/stl_util.h" namespace art { @@ -108,12 +109,12 @@ static inline int WhichPowerOf2(T x) { } // For rounding integers. -// NOTE: In the absence of std::omit_from_type_deduction<T> or std::identity<T>, use std::decay<T>. +// Note: Omit the `n` from T type deduction, deduce only from the `x` argument. template<typename T> -static constexpr T RoundDown(T x, typename std::decay<T>::type n) WARN_UNUSED; +static constexpr T RoundDown(T x, typename Identity<T>::type n) WARN_UNUSED; template<typename T> -static constexpr T RoundDown(T x, typename std::decay<T>::type n) { +static constexpr T RoundDown(T x, typename Identity<T>::type n) { return DCHECK_CONSTEXPR(IsPowerOfTwo(n), , T(0)) (x & -n); |