From 6bdad19f264b19eb1123023c3a44496e9e11ef34 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Tue, 3 May 2016 02:15:22 -0700 Subject: [PATCH] Deprecate boost::mpl Summary: [Folly] Deprecate `boost::mpl`. The `std` has equivalents; prefer them. Reviewed By: Gownta Differential Revision: D3247294 fb-gh-sync-id: 873697b7ea3ad069ff14662bc458a2e1cc840339 fbshipit-source-id: 873697b7ea3ad069ff14662bc458a2e1cc840339 --- folly/Traits.h | 13 +++++++------ folly/small_vector.h | 8 +++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/folly/Traits.h b/folly/Traits.h index 598a63a7..45f005cb 100644 --- a/folly/Traits.h +++ b/folly/Traits.h @@ -37,9 +37,7 @@ #endif #include -#include #include -#include namespace folly { @@ -289,8 +287,9 @@ template class shared_ptr; template struct has_nothrow_constructor< std::pair > - : ::boost::mpl::and_< has_nothrow_constructor, - has_nothrow_constructor > {}; + : std::integral_constant::value && + has_nothrow_constructor::value> {}; } // namespace boost @@ -298,8 +297,10 @@ namespace folly { // STL commonly-used types template -struct IsRelocatable< std::pair > - : ::boost::mpl::and_< IsRelocatable, IsRelocatable > {}; +struct IsRelocatable< std::pair > + : std::integral_constant::value && + IsRelocatable::value> {}; // Is T one of T1, T2, ..., Tn? template diff --git a/folly/small_vector.h b/folly/small_vector.h index f77efb30..827cf687 100644 --- a/folly/small_vector.h +++ b/folly/small_vector.h @@ -42,11 +42,11 @@ #include #include #include -#include #include #include #include +#include #include #if defined(__GNUC__) && (FOLLY_X64 || FOLLY_PPC64) @@ -355,10 +355,8 @@ class small_vector * into our value_type*, we will inline more than they asked.) */ enum { - MaxInline = boost::mpl::max< - boost::mpl::int_, - boost::mpl::int_ - >::type::value + MaxInline = + constexpr_max(sizeof(Value*) / sizeof(Value), RequestedMaxInline), }; public: -- 2.34.1