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

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: final fixups 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 | « Source/wtf/OwnPtr.h ('k') | Source/wtf/PartitionAlloc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/OwnPtrCommon.h
diff --git a/Source/wtf/OwnPtrCommon.h b/Source/wtf/OwnPtrCommon.h
index 5b3414b7975b48c7dbb6f9e2c9e5b513f00efe37..301629e82fd3cbc1e894afa97764e52fc4db2fa8 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, "use RefPtr for RefCounted objects");
+ static_assert(sizeof(T) > 0, "type must be complete");
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, "use RefPtr for RefCounted objects");
+ static_assert(sizeof(T) > 0, "type must be complete");
delete[] ptr;
}
};
template <class T, int n>
struct OwnedPtrDeleter<T[n]> {
- COMPILE_ASSERT(sizeof(T) < 0, DoNotUseArrayWithSizeAsType);
+ static_assert(sizeof(T) < 0, "do not use array with size as type");
};
} // namespace WTF
« no previous file with comments | « Source/wtf/OwnPtr.h ('k') | Source/wtf/PartitionAlloc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698