From 6031a6314c9369741c06c94f6c7b44ab62213a03 Mon Sep 17 00:00:00 2001 From: Marcelo Juchem Date: Thu, 16 Apr 2015 15:52:29 -0700 Subject: [PATCH] Deprecating folly::is_complete Summary: Deprecating folly::is_complete. Replacement is fatal::is_complete. Test Plan: unit tests Reviewed By: njormrod@fb.com Subscribers: njormrod, folly-diffs@, yfeldblum, chalfant FB internal diff: D1979124 Tasks: 6697454, 6697600 Signature: t1:1979124:1429153237:dc5736ed0f546dd4dd57bda9176e3c3c13b1235d --- folly/Traits.h | 28 ---------------------------- folly/test/TraitsTest.cpp | 8 -------- 2 files changed, 36 deletions(-) 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 { enum { value = std::is_same::value || IsOneOf::value }; }; -/** - * A traits class to check for incomplete types. - * - * Example: - * - * struct FullyDeclared {}; // complete type - * struct ForwardDeclared; // incomplete type - * - * is_complete::value // evaluates to true - * is_complete::value // evaluates to true - * is_complete::value // evaluates to false - * - * struct ForwardDeclared {}; // declared, at last - * - * is_complete::value // now it evaluates to true - * - * @author: Marcelo Juchem - */ -template -class is_complete { - template struct sfinae {}; - template - constexpr static bool test(sfinae*) { return true; } - template constexpr static bool test(...) { return false; } -public: - constexpr static bool value = test(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(254u))); } -struct CompleteType {}; -struct IncompleteType; -TEST(Traits, is_complete) { - EXPECT_TRUE((folly::is_complete::value)); - EXPECT_TRUE((folly::is_complete::value)); - EXPECT_FALSE((folly::is_complete::value)); -} - int main(int argc, char ** argv) { testing::InitGoogleTest(&argc, argv); gflags::ParseCommandLineFlags(&argc, &argv, true); -- 2.34.1