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

Unified Diff: components/history/core/android/android_history_types.cc

Issue 794683005: replace COMPILE_ASSERT with static_assert in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting fixup 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
Index: components/history/core/android/android_history_types.cc
diff --git a/components/history/core/android/android_history_types.cc b/components/history/core/android/android_history_types.cc
index 96e7ca35ef05a24f171ac461635ae563ad7a6846..c712101b679e1c7e76a4326616a7a37edbf989fa 100644
--- a/components/history/core/android/android_history_types.cc
+++ b/components/history/core/android/android_history_types.cc
@@ -31,9 +31,10 @@ class BookmarkIDMapping : public std::map<std::string,
HistoryAndBookmarkRow::ColumnID> {
public:
BookmarkIDMapping() {
- COMPILE_ASSERT(arraysize(kAndroidBookmarkColumn) <=
- HistoryAndBookmarkRow::COLUMN_END,
- Array_size_must_not_exceed_enum);
+ static_assert(arraysize(kAndroidBookmarkColumn) <=
+ HistoryAndBookmarkRow::COLUMN_END,
+ "kAndroidBookmarkColumn should not have more than "
+ "COLUMN_END elements");
for (size_t i = 0; i < arraysize(kAndroidBookmarkColumn); ++i) {
(*this)[kAndroidBookmarkColumn[i]] =
static_cast<HistoryAndBookmarkRow::ColumnID>(i);
@@ -49,8 +50,9 @@ class SearchIDMapping : public std::map<std::string,
SearchRow::ColumnID> {
public:
SearchIDMapping() {
- COMPILE_ASSERT(arraysize(kAndroidSearchColumn) <= SearchRow::COLUMN_END,
- Array_size_must_not_exceed_enum);
+ static_assert(arraysize(kAndroidSearchColumn) <= SearchRow::COLUMN_END,
+ "kAndroidSearchColumn should not have more than "
+ "COLUMN_END elements");
for (size_t i = 0; i < arraysize(kAndroidSearchColumn); ++i) {
(*this)[kAndroidSearchColumn[i]] =
static_cast<SearchRow::ColumnID>(i);
« no previous file with comments | « components/devtools_bridge/socket_tunnel_packet_handler.cc ('k') | components/nacl/loader/nacl_ipc_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698