Commit 94860dee authored by Joe Loser's avatar Joe Loser Committed by Facebook Github Bot

Use std::is_trivially_destructible instead of boost::has_trivial_destructor (#1003)

Summary:
- Use `std::is_trivially_destructible` instead of
  `boost::has_trivial_destructor` in a few places.
Pull Request resolved: https://github.com/facebook/folly/pull/1003

Reviewed By: lbrandy

Differential Revision: D13754694

Pulled By: yfeldblum

fbshipit-source-id: b32dbc901fd7c9cae681ac3436cc71ff075f30ec
parent 9e3f865f
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
#include <system_error> #include <system_error>
#include <type_traits> #include <type_traits>
#include <boost/type_traits/has_trivial_destructor.hpp>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Likely.h> #include <folly/Likely.h>
#include <folly/Random.h> #include <folly/Random.h>
...@@ -136,8 +134,8 @@ template < ...@@ -136,8 +134,8 @@ template <
typename Hash = std::hash<Key>, typename Hash = std::hash<Key>,
typename KeyEqual = std::equal_to<Key>, typename KeyEqual = std::equal_to<Key>,
bool SkipKeyValueDeletion = bool SkipKeyValueDeletion =
(boost::has_trivial_destructor<Key>::value && (std::is_trivially_destructible<Key>::value &&
boost::has_trivial_destructor<Value>::value), std::is_trivially_destructible<Value>::value),
template <typename> class Atom = std::atomic, template <typename> class Atom = std::atomic,
typename IndexType = uint32_t, typename IndexType = uint32_t,
typename Allocator = folly::detail::MMapAlloc> typename Allocator = folly::detail::MMapAlloc>
...@@ -478,8 +476,8 @@ template < ...@@ -478,8 +476,8 @@ template <
typename Hash = std::hash<Key>, typename Hash = std::hash<Key>,
typename KeyEqual = std::equal_to<Key>, typename KeyEqual = std::equal_to<Key>,
bool SkipKeyValueDeletion = bool SkipKeyValueDeletion =
(boost::has_trivial_destructor<Key>::value && (std::is_trivially_destructible<Key>::value &&
boost::has_trivial_destructor<Value>::value), std::is_trivially_destructible<Value>::value),
template <typename> class Atom = std::atomic, template <typename> class Atom = std::atomic,
typename Allocator = folly::detail::MMapAlloc> typename Allocator = folly::detail::MMapAlloc>
using AtomicUnorderedInsertMap64 = AtomicUnorderedInsertMap< using AtomicUnorderedInsertMap64 = AtomicUnorderedInsertMap<
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <vector> #include <vector>
#include <boost/random.hpp> #include <boost/random.hpp>
#include <boost/type_traits.hpp>
#include <glog/logging.h> #include <glog/logging.h>
#include <folly/Memory.h> #include <folly/Memory.h>
...@@ -83,7 +82,7 @@ class SkipListNode { ...@@ -83,7 +82,7 @@ class SkipListNode {
template <typename NodeAlloc> template <typename NodeAlloc>
struct DestroyIsNoOp : StrictConjunction< struct DestroyIsNoOp : StrictConjunction<
AllocatorHasTrivialDeallocate<NodeAlloc>, AllocatorHasTrivialDeallocate<NodeAlloc>,
boost::has_trivial_destructor<SkipListNode>> {}; std::is_trivially_destructible<SkipListNode>> {};
// copy the head node to a new head node assuming lock acquired // copy the head node to a new head node assuming lock acquired
SkipListNode* copyHead(SkipListNode* node) { SkipListNode* copyHead(SkipListNode* node) {
......
...@@ -109,8 +109,8 @@ using UIM = AtomicUnorderedInsertMap< ...@@ -109,8 +109,8 @@ using UIM = AtomicUnorderedInsertMap<
Value, Value,
std::hash<Key>, std::hash<Key>,
std::equal_to<Key>, std::equal_to<Key>,
(boost::has_trivial_destructor<Key>::value && (std::is_trivially_destructible<Key>::value &&
boost::has_trivial_destructor<Value>::value), std::is_trivially_destructible<Value>::value),
Atom, Atom,
IndexType, IndexType,
Allocator>; Allocator>;
......
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