From 2f5fcde0698e2f6ad536201c158e0cf324033d62 Mon Sep 17 00:00:00 2001 From: Jon Maltiel Swenson Date: Wed, 24 Aug 2016 09:35:48 -0700 Subject: [PATCH] Prevent compiler warning about mixing enumeral and non-enumeral types in ternary expression Summary: The GCC warning "warning: enumeral and non-enumeral type in conditional expression" is logged a lot in many builds since lots of code depends on small_vector. This diff should prevent those warnings. Reviewed By: yfeldblum Differential Revision: D3762835 fbshipit-source-id: 49831e4364e716592287c05d1dbf1912326324f6 --- folly/small_vector.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/folly/small_vector.h b/folly/small_vector.h index 3da912d2..c1d6cd5f 100644 --- a/folly/small_vector.h +++ b/folly/small_vector.h @@ -345,12 +345,10 @@ class small_vector * the user asks for less inlined elements than we can fit unioned * into our value_type*, we will inline more than they asked.) */ - enum { - MaxInline = - constexpr_max(sizeof(Value*) / sizeof(Value), RequestedMaxInline), - }; + static constexpr std::size_t MaxInline{ + constexpr_max(sizeof(Value*) / sizeof(Value), RequestedMaxInline)}; -public: + public: typedef std::size_t size_type; typedef Value value_type; typedef value_type& reference; -- 2.34.1