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

Unified Diff: Source/wtf/OwnPtrCommon.h

Issue 802203004: replace COMPILE_ASSERT with static assert in wtf/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.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
Index: Source/wtf/OwnPtrCommon.h
diff --git a/Source/wtf/OwnPtrCommon.h b/Source/wtf/OwnPtrCommon.h
index 5b3414b7975b48c7dbb6f9e2c9e5b513f00efe37..ff913f2195c0db6c31e0a450737dd17d5d1f022e 100644
--- a/Source/wtf/OwnPtrCommon.h
+++ b/Source/wtf/OwnPtrCommon.h
@@ -47,8 +47,8 @@ template <typename T>
struct OwnedPtrDeleter {
static void deletePtr(T* ptr)
{
- COMPILE_ASSERT(!IsRefCounted<T>::value, UseRefPtrForRefCountedObjects);
- COMPILE_ASSERT(sizeof(T) > 0, TypeMustBeComplete);
+ static_assert(!IsRefCounted<T>::value, "UseRefPtrForRefCountedObjects");
+ static_assert(sizeof(T) > 0, "TypeMustBeComplete");
delete ptr;
}
};
@@ -57,15 +57,15 @@ template <typename T>
struct OwnedPtrDeleter<T[]> {
static void deletePtr(T* ptr)
{
- COMPILE_ASSERT(!IsRefCounted<T>::value, UseRefPtrForRefCountedObjects);
- COMPILE_ASSERT(sizeof(T) > 0, TypeMustBeComplete);
+ static_assert(!IsRefCounted<T>::value, "UseRefPtrForRefCountedObjects");
+ static_assert(sizeof(T) > 0, "TypeMustBeComplete");
delete[] ptr;
}
};
template <class T, int n>
struct OwnedPtrDeleter<T[n]> {
- COMPILE_ASSERT(sizeof(T) < 0, DoNotUseArrayWithSizeAsType);
+ static_assert(sizeof(T) < 0, "DoNotUseArrayWithSizeAsType");
};
} // namespace WTF
« Source/wtf/HashTable.h ('K') | « Source/wtf/OwnPtr.h ('k') | Source/wtf/PartitionAlloc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698