Commit 6bdad19f authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot 6

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
parent 7c5318a4
...@@ -37,9 +37,7 @@ ...@@ -37,9 +37,7 @@
#endif #endif
#include <boost/type_traits.hpp> #include <boost/type_traits.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/has_xxx.hpp> #include <boost/mpl/has_xxx.hpp>
#include <boost/mpl/not.hpp>
namespace folly { namespace folly {
...@@ -289,8 +287,9 @@ template <class T> class shared_ptr; ...@@ -289,8 +287,9 @@ template <class T> class shared_ptr;
template <class T, class U> template <class T, class U>
struct has_nothrow_constructor< std::pair<T, U> > struct has_nothrow_constructor< std::pair<T, U> >
: ::boost::mpl::and_< has_nothrow_constructor<T>, : std::integral_constant<bool,
has_nothrow_constructor<U> > {}; has_nothrow_constructor<T>::value &&
has_nothrow_constructor<U>::value> {};
} // namespace boost } // namespace boost
...@@ -298,8 +297,10 @@ namespace folly { ...@@ -298,8 +297,10 @@ namespace folly {
// STL commonly-used types // STL commonly-used types
template <class T, class U> template <class T, class U>
struct IsRelocatable< std::pair<T, U> > struct IsRelocatable< std::pair<T, U> >
: ::boost::mpl::and_< IsRelocatable<T>, IsRelocatable<U> > {}; : std::integral_constant<bool,
IsRelocatable<T>::value &&
IsRelocatable<U>::value> {};
// Is T one of T1, T2, ..., Tn? // Is T one of T1, T2, ..., Tn?
template <class T, class... Ts> template <class T, class... Ts>
......
...@@ -42,11 +42,11 @@ ...@@ -42,11 +42,11 @@
#include <boost/mpl/empty.hpp> #include <boost/mpl/empty.hpp>
#include <boost/mpl/size.hpp> #include <boost/mpl/size.hpp>
#include <boost/mpl/count.hpp> #include <boost/mpl/count.hpp>
#include <boost/mpl/max.hpp>
#include <folly/FormatTraits.h> #include <folly/FormatTraits.h>
#include <folly/Malloc.h> #include <folly/Malloc.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#include <folly/portability/Constexpr.h>
#include <folly/portability/Malloc.h> #include <folly/portability/Malloc.h>
#if defined(__GNUC__) && (FOLLY_X64 || FOLLY_PPC64) #if defined(__GNUC__) && (FOLLY_X64 || FOLLY_PPC64)
...@@ -355,10 +355,8 @@ class small_vector ...@@ -355,10 +355,8 @@ class small_vector
* into our value_type*, we will inline more than they asked.) * into our value_type*, we will inline more than they asked.)
*/ */
enum { enum {
MaxInline = boost::mpl::max< MaxInline =
boost::mpl::int_<sizeof(Value*) / sizeof(Value)>, constexpr_max(sizeof(Value*) / sizeof(Value), RequestedMaxInline),
boost::mpl::int_<RequestedMaxInline>
>::type::value
}; };
public: public:
......
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