From: Nicholas Ormrod <njormrod@fb.com>
Date: Sat, 18 Apr 2015 17:57:56 +0000 (-0700)
Subject: Revert "Revert "Deprecating folly::is_complete""
X-Git-Tag: v0.36.0~23
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7d1d6185e473b56c9e7421e2e65cea54436b576d;p=folly.git

Revert "Revert "Deprecating folly::is_complete""

Summary:
This reverts commit 95a80fd4cb5a4b31b41b34fd24d591e0fc1b0650.

Test Plan: n/a

Reviewed By: andrewjcg@fb.com

Subscribers: trunkagent, folly-diffs@, yfeldblum, chalfant

FB internal diff: D2004342

Tasks: 6804947

Signature: t1:2004342:1429332777:4dd1c45e22ee4da69e5e84d3c5f67bada263f307

Blame Revision: D2002345
---

diff --git a/folly/Traits.h b/folly/Traits.h
index 58e9418a..309157c4 100644
--- a/folly/Traits.h
+++ b/folly/Traits.h
@@ -290,34 +290,6 @@ struct IsOneOf<T, T1, Ts...> {
   enum { value = std::is_same<T, T1>::value || IsOneOf<T, Ts...>::value };
 };
 
-/**
- * A traits class to check for incomplete types.
- *
- * Example:
- *
- *  struct FullyDeclared {}; // complete type
- *  struct ForwardDeclared; // incomplete type
- *
- *  is_complete<int>::value // evaluates to true
- *  is_complete<FullyDeclared>::value // evaluates to true
- *  is_complete<ForwardDeclared>::value // evaluates to false
- *
- *  struct ForwardDeclared {}; // declared, at last
- *
- *  is_complete<ForwardDeclared>::value // now it evaluates to true
- *
- * @author: Marcelo Juchem <marcelo@fb.com>
- */
-template <typename T>
-class is_complete {
-  template <unsigned long long> struct sfinae {};
-  template <typename U>
-  constexpr static bool test(sfinae<sizeof(U)>*) { return true; }
-  template <typename> constexpr static bool test(...) { return false; }
-public:
-  constexpr static bool value = test<T>(nullptr);
-};
-
 /*
  * Complementary type traits for integral comparisons.
  *
diff --git a/folly/test/TraitsTest.cpp b/folly/test/TraitsTest.cpp
index 695e36d6..83ffb43d 100644
--- a/folly/test/TraitsTest.cpp
+++ b/folly/test/TraitsTest.cpp
@@ -110,14 +110,6 @@ TEST(Traits, relational) {
   EXPECT_FALSE((folly::greater_than<uint8_t, 255u, uint8_t>(254u)));
 }
 
-struct CompleteType {};
-struct IncompleteType;
-TEST(Traits, is_complete) {
-  EXPECT_TRUE((folly::is_complete<int>::value));
-  EXPECT_TRUE((folly::is_complete<CompleteType>::value));
-  EXPECT_FALSE((folly::is_complete<IncompleteType>::value));
-}
-
 int main(int argc, char ** argv) {
   testing::InitGoogleTest(&argc, argv);
   gflags::ParseCommandLineFlags(&argc, &argv, true);