Commit 3f7a734c authored by Meng Zhang's avatar Meng Zhang Committed by Facebook Github Bot

Back out "[folly][PR] Allow trivially move constructible types to be relocatable"

Summary: Original commit changeset: 1e15d312d1a8

Reviewed By: Orvid

Differential Revision: D14265880

fbshipit-source-id: 8c2ad3e15334015dadc19bf77b061f66086adcd6
parent cee1964d
......@@ -456,9 +456,10 @@ template <class T>
struct IsRelocatable : std::conditional<
traits_detail::has_IsRelocatable<T>::value,
traits_detail::has_true_IsRelocatable<T>,
bool_constant<
std::is_trivially_move_constructible<T>::value ||
is_trivially_copyable<T>::value>>::type {};
// TODO add this line (and some tests for it) when we
// upgrade to gcc 4.7
// std::is_trivially_move_constructible<T>::value ||
is_trivially_copyable<T>>::type {};
template <class T>
struct IsZeroInitializable
......
......@@ -21,7 +21,6 @@
#include <type_traits>
#include <utility>
#include <folly/Portability.h>
#include <folly/ScopeGuard.h>
#include <folly/portability/GTest.h>
......@@ -99,21 +98,6 @@ TEST(Traits, unset) {
EXPECT_TRUE(IsRelocatable<F4>::value);
}
TEST(Traits, triviallyMoveConstructible) {
FOLLY_PUSH_WARNING
FOLLY_CLANG_DISABLE_WARNING("-Wunneeded-member-function")
struct TriviallyMoveConstructible {
TriviallyMoveConstructible(const TriviallyMoveConstructible&) = delete;
TriviallyMoveConstructible& operator=(const TriviallyMoveConstructible&) =
delete;
TriviallyMoveConstructible(TriviallyMoveConstructible&&) = default;
TriviallyMoveConstructible& operator=(TriviallyMoveConstructible&&) =
delete;
};
EXPECT_TRUE(IsRelocatable<TriviallyMoveConstructible>::value);
FOLLY_POP_WARNING
}
TEST(Traits, bitAndInit) {
EXPECT_TRUE(IsZeroInitializable<int>::value);
EXPECT_FALSE(IsZeroInitializable<vector<int>>::value);
......
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