Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4429)

Unified Diff: cc/base/util.h

Issue 804373004: replace COMPILE_ASSERT with static_assert in cc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/animation/animation.cc ('k') | cc/output/geometry_binding.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « cc/animation/animation.cc ('k') | cc/output/geometry_binding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698