Commit d3555e67 authored by Martin Martin's avatar Martin Martin Committed by Facebook Github Bot

const -> constexpr in folly::small_vector

Summary: const -> constexpr in folly::small_vector

Reviewed By: yfeldblum

Differential Revision: D5814264

fbshipit-source-id: 4631bb7f3f04906636e5a188d4aa0d33ad796a3c
parent 053c0a86
...@@ -259,10 +259,10 @@ struct IntegralSizePolicy { ...@@ -259,10 +259,10 @@ struct IntegralSizePolicy {
} }
protected: protected:
static bool const kShouldUseHeap = ShouldUseHeap; static bool constexpr kShouldUseHeap = ShouldUseHeap;
private: private:
static SizeType const kExternMask = static SizeType constexpr kExternMask =
kShouldUseHeap ? SizeType(1) << (sizeof(SizeType) * 8 - 1) : 0; kShouldUseHeap ? SizeType(1) << (sizeof(SizeType) * 8 - 1) : 0;
SizeType size_; SizeType size_;
...@@ -1081,15 +1081,17 @@ class small_vector : public detail::small_vector_base< ...@@ -1081,15 +1081,17 @@ class small_vector : public detail::small_vector_base<
InlineStorageDataType, InlineStorageDataType,
void*>::type InlineStorageType; void*>::type InlineStorageType;
static bool const kHasInlineCapacity = static bool constexpr kHasInlineCapacity =
sizeof(HeapPtrWithCapacity) < sizeof(InlineStorageType); sizeof(HeapPtrWithCapacity) < sizeof(InlineStorageType);
// This value should we multiple of word size. // This value should we multiple of word size.
static size_t const kHeapifyCapacitySize = sizeof( static size_t constexpr kHeapifyCapacitySize = sizeof(
typename std:: typename std::
aligned_storage<sizeof(InternalSizeType), alignof(value_type)>::type); aligned_storage<sizeof(InternalSizeType), alignof(value_type)>::type);
// Threshold to control capacity heapifying. // Threshold to control capacity heapifying.
static size_t const kHeapifyCapacityThreshold = 100 * kHeapifyCapacitySize; static size_t constexpr kHeapifyCapacityThreshold =
100 * kHeapifyCapacitySize;
typedef typename std:: typedef typename std::
conditional<kHasInlineCapacity, HeapPtrWithCapacity, HeapPtr>::type conditional<kHasInlineCapacity, HeapPtrWithCapacity, HeapPtr>::type
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment