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

Unified Diff: Source/wtf/ListHashSet.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/HashTable.h ('k') | Source/wtf/OwnPtr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/ListHashSet.h
diff --git a/Source/wtf/ListHashSet.h b/Source/wtf/ListHashSet.h
index 52b2906becfdcfe3026b9ffbaab3ba5ee5f68678..52f74bb6deba7e6883d78c4df1e5768a1b9a15a7 100644
--- a/Source/wtf/ListHashSet.h
+++ b/Source/wtf/ListHashSet.h
@@ -360,7 +360,7 @@ namespace WTF {
void* operator new(size_t, NodeAllocator* allocator)
{
- COMPILE_ASSERT(sizeof(ListHashSetNode) == sizeof(ListHashSetNodeBase<ValueArg>), PleaseAddAnyFieldsToTheBase);
+ static_assert(sizeof(ListHashSetNode) == sizeof(ListHashSetNodeBase<ValueArg>), "please add any fields to the base");
return allocator->allocateNode();
}
@@ -695,7 +695,7 @@ namespace WTF {
template<typename T, size_t inlineCapacity, typename U, typename V>
inline void ListHashSet<T, inlineCapacity, U, V>::finalize()
{
- COMPILE_ASSERT(!Allocator::isGarbageCollected, FinalizeOnHeapAllocatedListHashSetShouldNeverBeCalled);
+ static_assert(!Allocator::isGarbageCollected, "heap allocated ListHashSet should never call finalize()");
deleteAllNodes();
}
@@ -996,7 +996,7 @@ namespace WTF {
template<typename T, size_t inlineCapacity, typename U, typename V>
void ListHashSet<T, inlineCapacity, U, V>::trace(typename Allocator::Visitor* visitor)
{
- COMPILE_ASSERT(HashTraits<T>::weakHandlingFlag == NoWeakHandlingInCollections, ListHashSetDoesNotSupportWeakness);
+ static_assert(HashTraits<T>::weakHandlingFlag == NoWeakHandlingInCollections, "ListHashSet does not support weakness");
// This marks all the nodes and their contents live that can be
// accessed through the HashTable. That includes m_head and m_tail
// so we do not have to explicitly trace them here.
« no previous file with comments | « Source/wtf/HashTable.h ('k') | Source/wtf/OwnPtr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698