Remove construct_in_place
authorYedidya Feldblum <yfeldblum@fb.com>
Sun, 2 Jul 2017 17:22:29 +0000 (10:22 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 2 Jul 2017 17:40:23 +0000 (10:40 -0700)
Summary:
[Folly] Remove `construct_in_place`.

It is an alias for `in_place`, and unnecessary.

Reviewed By: Orvid

Differential Revision: D5362354

fbshipit-source-id: 39ce07bad87185e506fe7d780789b78060008182

folly/Expected.h
folly/Synchronized.h
folly/Traits.h
folly/test/SynchronizedTestLib-inl.h

index 2b791c117810d73f6772e18645c90de2287d7546..22f439432a85386467b0653c123bf76d6fe724c9 100644 (file)
@@ -32,7 +32,7 @@
 #include <folly/Likely.h>
 #include <folly/Portability.h>
 #include <folly/Preprocessor.h>
-#include <folly/Traits.h> // for construct_in_place_t
+#include <folly/Traits.h> // for in_place_t
 #include <folly/Unit.h>
 
 #define FOLLY_EXPECTED_ID(X) FB_CONCATENATE(FB_CONCATENATE(Folly, X), __LINE__)
index 4fce71b580d5e2f83b0eaf78d24a2fb429423253..2054aa06db0306692a17a1ec0cbd3e39e57d8076 100644 (file)
@@ -491,10 +491,10 @@ struct Synchronized : public SynchronizedBase<
 
   /**
    * Lets you construct non-movable types in-place. Use the constexpr
-   * instance `construct_in_place` as the first argument.
+   * instance `in_place` as the first argument.
    */
   template <typename... Args>
-  explicit Synchronized(construct_in_place_t, Args&&... args)
+  explicit Synchronized(in_place_t, Args&&... args)
       : datum_(std::forward<Args>(args)...) {}
 
   /**
index de720a4eb6a4eaf11e22f3022ef747c9ecdb81a5..cda84d242936cf98fb544b2118cae8ca17aea594 100644 (file)
@@ -647,14 +647,6 @@ inline traits_detail::InPlaceIndexTag<I> in_place_index(
   return {};
 }
 
-// For backwards compatibility:
-using construct_in_place_t = in_place_t;
-
-inline traits_detail::InPlaceTag construct_in_place(
-    traits_detail::InPlaceTag = {}) {
-  return {};
-}
-
 /**
  * Initializer lists are a powerful compile time syntax introduced in C++11
  * but due to their often conflicting syntax they are not used by APIs for
index 997069503b15727a94b70a6e7f089ca8390ee961..33b91bef9388821e9f2750cf544154227876c994 100644 (file)
@@ -873,10 +873,8 @@ struct NotCopiableNotMovable {
 };
 
 template <class Mutex> void testInPlaceConstruction() {
-  // This won't compile without construct_in_place
-  folly::Synchronized<NotCopiableNotMovable> a(
-    folly::construct_in_place, 5, "a"
-  );
+  // This won't compile without in_place
+  folly::Synchronized<NotCopiableNotMovable> a(folly::in_place, 5, "a");
 }
 }
 }