Commit f52d7dc8 authored by Joe Loser's avatar Joe Loser Committed by Facebook Github Bot

Replace Not with folly::Negation in PolyDetail.h (#1045)

Summary:
- Replace `Not` template alias from `PolyDetail.h` with `folly::Negation` from
 `folly/Traits.h` which does the same thing.
Pull Request resolved: https://github.com/facebook/folly/pull/1045

Reviewed By: ericniebler

Differential Revision: D14402105

Pulled By: yfeldblum

fbshipit-source-id: 100347dbdc159c5217c7452b202650d58d80850c
parent ac744ab3
......@@ -422,15 +422,13 @@ constexpr bool poly_empty(Poly<I&> const&) noexcept {
*/
template <
class I,
std::enable_if_t<detail::Not<std::is_reference<I>>::value, int> = 0>
std::enable_if_t<Negation<std::is_reference<I>>::value, int> = 0>
constexpr Poly<I>&& poly_move(detail::PolyRoot<I>& that) noexcept {
return static_cast<Poly<I>&&>(static_cast<Poly<I>&>(that));
}
/// \overload
template <
class I,
std::enable_if_t<detail::Not<std::is_const<I>>::value, int> = 0>
template <class I, std::enable_if_t<Negation<std::is_const<I>>::value, int> = 0>
Poly<I&&> poly_move(detail::PolyRoot<I&> const& that) noexcept {
return detail::PolyAccess::move(that);
}
......
......@@ -187,9 +187,6 @@ struct IsInstanceOf : std::false_type {};
template <class... Ts, template <class...> class U>
struct IsInstanceOf<U<Ts...>, U> : std::true_type {};
template <class T>
using Not = Bool<!T::value>;
template <class Then>
decltype(auto) if_constexpr(std::true_type, Then then) {
return then(Identity{});
......@@ -601,7 +598,7 @@ void* execOnHeap(Op op, Data* from, void* to) {
template <
class I,
class T,
std::enable_if_t<Not<std::is_reference<T>>::value, int> = 0>
std::enable_if_t<Negation<std::is_reference<T>>::value, int> = 0>
void* execOnHeap(Op op, Data* from, void* to) {
switch (op) {
case Op::eNuke:
......@@ -901,7 +898,7 @@ template <
class T,
class I,
class U = std::decay_t<T>,
std::enable_if_t<Not<std::is_base_of<PolyBase, U>>::value, int> = 0,
std::enable_if_t<Negation<std::is_base_of<PolyBase, U>>::value, int> = 0,
std::enable_if_t<std::is_constructible<AddCvrefOf<U, I>, T>::value, int> =
0,
class = MembersOf<std::decay_t<I>, U>>
......
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