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

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: search/replace 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: Source/wtf/ListHashSet.h
diff --git a/Source/wtf/ListHashSet.h b/Source/wtf/ListHashSet.h
index 52b2906becfdcfe3026b9ffbaab3ba5ee5f68678..a395bbe5421f1b438212073ee31c6b9de098e924 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");
Nico 2014/12/16 17:56:28 uber nit: I'd lower case the first character of th
Mostyn Bramley-Moore 2014/12/16 19:00:37 Done. Should we add this to the style guide?
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, "ListHashSetDoesNotSupportWeakness");
Nico 2014/12/16 17:56:28 intentionally no spaces here?
Mostyn Bramley-Moore 2014/12/16 19:00:37 Fixed.
// 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') | Source/wtf/Vector.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698