Commit 6b73d5f5 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

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
parent 10fb4bb8
......@@ -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__)
......
......@@ -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)...) {}
/**
......
......@@ -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
......
......@@ -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");
}
}
}
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