From d3555e67ca3c8ad89eda5e689d46cd7fa2840356 Mon Sep 17 00:00:00 2001 From: Martin Martin Date: Tue, 12 Sep 2017 11:51:07 -0700 Subject: [PATCH] const -> constexpr in folly::small_vector Summary: const -> constexpr in folly::small_vector Reviewed By: yfeldblum Differential Revision: D5814264 fbshipit-source-id: 4631bb7f3f04906636e5a188d4aa0d33ad796a3c --- folly/small_vector.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/folly/small_vector.h b/folly/small_vector.h index 668181c7..a369e7ee 100644 --- a/folly/small_vector.h +++ b/folly/small_vector.h @@ -259,10 +259,10 @@ struct IntegralSizePolicy { } protected: - static bool const kShouldUseHeap = ShouldUseHeap; + static bool constexpr kShouldUseHeap = ShouldUseHeap; private: - static SizeType const kExternMask = + static SizeType constexpr kExternMask = kShouldUseHeap ? SizeType(1) << (sizeof(SizeType) * 8 - 1) : 0; SizeType size_; @@ -1081,15 +1081,17 @@ class small_vector : public detail::small_vector_base< InlineStorageDataType, void*>::type InlineStorageType; - static bool const kHasInlineCapacity = + static bool constexpr kHasInlineCapacity = sizeof(HeapPtrWithCapacity) < sizeof(InlineStorageType); // This value should we multiple of word size. - static size_t const kHeapifyCapacitySize = sizeof( + static size_t constexpr kHeapifyCapacitySize = sizeof( typename std:: aligned_storage::type); + // Threshold to control capacity heapifying. - static size_t const kHeapifyCapacityThreshold = 100 * kHeapifyCapacitySize; + static size_t constexpr kHeapifyCapacityThreshold = + 100 * kHeapifyCapacitySize; typedef typename std:: conditional::type -- 2.34.1