From 6b73d5f550cc78e167eec2963fcf2c52b8e62409 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Sun, 2 Jul 2017 10:22:29 -0700 Subject: [PATCH] Remove construct_in_place 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 | 2 +- folly/Synchronized.h | 4 ++-- folly/Traits.h | 8 -------- folly/test/SynchronizedTestLib-inl.h | 6 ++---- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/folly/Expected.h b/folly/Expected.h index 2b791c11..22f43943 100644 --- a/folly/Expected.h +++ b/folly/Expected.h @@ -32,7 +32,7 @@ #include #include #include -#include // for construct_in_place_t +#include // for in_place_t #include #define FOLLY_EXPECTED_ID(X) FB_CONCATENATE(FB_CONCATENATE(Folly, X), __LINE__) diff --git a/folly/Synchronized.h b/folly/Synchronized.h index 4fce71b5..2054aa06 100644 --- a/folly/Synchronized.h +++ b/folly/Synchronized.h @@ -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 - explicit Synchronized(construct_in_place_t, Args&&... args) + explicit Synchronized(in_place_t, Args&&... args) : datum_(std::forward(args)...) {} /** diff --git a/folly/Traits.h b/folly/Traits.h index de720a4e..cda84d24 100644 --- a/folly/Traits.h +++ b/folly/Traits.h @@ -647,14 +647,6 @@ inline traits_detail::InPlaceIndexTag 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 diff --git a/folly/test/SynchronizedTestLib-inl.h b/folly/test/SynchronizedTestLib-inl.h index 99706950..33b91bef 100644 --- a/folly/test/SynchronizedTestLib-inl.h +++ b/folly/test/SynchronizedTestLib-inl.h @@ -873,10 +873,8 @@ struct NotCopiableNotMovable { }; template void testInPlaceConstruction() { - // This won't compile without construct_in_place - folly::Synchronized a( - folly::construct_in_place, 5, "a" - ); + // This won't compile without in_place + folly::Synchronized a(folly::in_place, 5, "a"); } } } -- 2.34.1