Chromium Code Reviews| Index: Source/wtf/HashTable.h |
| diff --git a/Source/wtf/HashTable.h b/Source/wtf/HashTable.h |
| index 3f907bf4685973ab2c8b2d997c8b745419fac129..d959514e0df70bec67be1d63a79ea52e5c3a83ea 100644 |
| --- a/Source/wtf/HashTable.h |
| +++ b/Source/wtf/HashTable.h |
| @@ -600,9 +600,9 @@ namespace WTF { |
| template<unsigned size> |
| struct HashTableCapacityForSize { |
| static const unsigned value = HashTableCapacityForSizeSplitter<size, !(size & (size - 1))>::value; |
| - COMPILE_ASSERT(size > 0, HashTableNonZeroMinimumCapacity); |
| - COMPILE_ASSERT(!static_cast<int>(value >> 31), HashTableNoCapacityOverflow); |
| - COMPILE_ASSERT(value > (2 * size), HashTableCapacityHoldsContentSize); |
| + static_assert(size > 0, "HashTableNonZeroMinimumCapacity"); |
| + static_assert(!static_cast<int>(value >> 31), "HashTableNoCapacityOverflow"); |
| + static_assert(value > (2 * size), "HashTableCapacityHoldsContentSize"); |
| }; |
| template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits, typename Allocator> |
| @@ -993,7 +993,7 @@ namespace WTF { |
| // like to check this on the whole value (key-value pair), but |
| // IsPolymorphic will return false for a pair of two types, even if |
| // one of the components is polymorphic. |
| - COMPILE_ASSERT(!Traits::emptyValueIsZero || !IsPolymorphic<KeyType>::value, EmptyValueCannotBeZeroForThingsWithAVtable); |
| + static_assert(!Traits::emptyValueIsZero || !IsPolymorphic<KeyType>::value, "EmptyValueCannotBeZeroForThingsWithAVtable"); |
|
Nico
2014/12/16 00:57:24
At least for things where it's obvious how to do i
|
| if (Traits::emptyValueIsZero) { |
| result = Allocator::template allocateZeroedHashTableBacking<ValueType, HashTable>(allocSize); |
| } else { |