Index: cc/base/util.h |
diff --git a/cc/base/util.h b/cc/base/util.h |
index 1d716ae2a42f4b4d25f1bf38e6fb38a4a9c806a3..a16d4855283f849c0330efcd79a339a2982f0271 100644 |
--- a/cc/base/util.h |
+++ b/cc/base/util.h |
@@ -12,13 +12,15 @@ |
namespace cc { |
template <typename T> T RoundUp(T n, T mul) { |
- COMPILE_ASSERT(std::numeric_limits<T>::is_integer, type_must_be_integral); |
+ static_assert(std::numeric_limits<T>::is_integer, |
+ "T must be an integer type"); |
return (n > 0) ? ((n + mul - 1) / mul) * mul |
: (n / mul) * mul; |
} |
template <typename T> T RoundDown(T n, T mul) { |
- COMPILE_ASSERT(std::numeric_limits<T>::is_integer, type_must_be_integral); |
+ static_assert(std::numeric_limits<T>::is_integer, |
+ "T must be an integer type"); |
return (n > 0) ? (n / mul) * mul |
: (n == 0) ? 0 |
: ((n - mul + 1) / mul) * mul; |