diff --git a/folly/ExceptionWrapper.h b/folly/ExceptionWrapper.h index 3bdc7ae027c3f289f9a599a2f2c6e4c5f403326f..a9ff236f8c1aac879b85c49ab3a481472307b7f7 100644 --- a/folly/ExceptionWrapper.h +++ b/folly/ExceptionWrapper.h @@ -52,7 +52,7 @@ FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS namespace folly { #define FOLLY_REQUIRES_DEF(...) \ - _t<std::enable_if<static_cast<bool>(__VA_ARGS__), long>> + std::enable_if_t<static_cast<bool>(__VA_ARGS__), long> #define FOLLY_REQUIRES(...) FOLLY_REQUIRES_DEF(__VA_ARGS__) = __LINE__ diff --git a/folly/Indestructible.h b/folly/Indestructible.h index e266c0536b09974f57d00c995def058bd1710398..1edc65e0d6fcd7f6a1f0e79e27415254be2995e2 100644 --- a/folly/Indestructible.h +++ b/folly/Indestructible.h @@ -80,21 +80,21 @@ class Indestructible final { */ template < typename U = T, - _t<std::enable_if<std::is_constructible<T, U&&>::value>>* = nullptr, - _t<std::enable_if< - !std::is_same<Indestructible<T>, remove_cvref_t<U>>::value>>* = + std::enable_if_t<std::is_constructible<T, U&&>::value>* = nullptr, + std::enable_if_t< + !std::is_same<Indestructible<T>, remove_cvref_t<U>>::value>* = nullptr, - _t<std::enable_if<!std::is_convertible<U&&, T>::value>>* = nullptr> + std::enable_if_t<!std::is_convertible<U&&, T>::value>* = nullptr> explicit constexpr Indestructible(U&& u) noexcept( noexcept(T(std::declval<U>()))) : storage_(std::forward<U>(u)) {} template < typename U = T, - _t<std::enable_if<std::is_constructible<T, U&&>::value>>* = nullptr, - _t<std::enable_if< - !std::is_same<Indestructible<T>, remove_cvref_t<U>>::value>>* = + std::enable_if_t<std::is_constructible<T, U&&>::value>* = nullptr, + std::enable_if_t< + !std::is_same<Indestructible<T>, remove_cvref_t<U>>::value>* = nullptr, - _t<std::enable_if<std::is_convertible<U&&, T>::value>>* = nullptr> + std::enable_if_t<std::is_convertible<U&&, T>::value>* = nullptr> /* implicit */ constexpr Indestructible(U&& u) noexcept( noexcept(T(std::declval<U>()))) : storage_(std::forward<U>(u)) {} diff --git a/folly/Memory.h b/folly/Memory.h index e886219e3d80fa0fa3de846c24fb3e21ab39a55d..1601bc34f1bd88ff84fe61c95d745e396ae59443 100644 --- a/folly/Memory.h +++ b/folly/Memory.h @@ -476,7 +476,7 @@ class AlignedSysAllocator : private Align { // TODO: remove this ctor, which is required only by gcc49 template < typename S = Align, - _t<std::enable_if<std::is_default_constructible<S>::value, int>> = 0> + std::enable_if_t<std::is_default_constructible<S>::value, int> = 0> constexpr AlignedSysAllocator() noexcept(noexcept(Align())) : Align() {} template <typename U> diff --git a/folly/ThreadLocal.h b/folly/ThreadLocal.h index be61e84fea6adc9b811053ae534909e2a971730a..ca8fa30c448ba5e4c04d60f3b2444efbe05a5c2c 100644 --- a/folly/ThreadLocal.h +++ b/folly/ThreadLocal.h @@ -60,9 +60,7 @@ class ThreadLocal { public: constexpr ThreadLocal() : constructor_([]() { return new T(); }) {} - template < - typename F, - _t<std::enable_if<is_invocable_r<T*, F>::value, int>> = 0> + template <typename F, std::enable_if_t<is_invocable_r<T*, F>::value, int> = 0> explicit ThreadLocal(F&& constructor) : constructor_(std::forward<F>(constructor)) {} diff --git a/folly/lang/PropagateConst.h b/folly/lang/PropagateConst.h index 71d88cbf6767c45011a69307313c23d475997f94..d072ca926fc078ef551c4d30fecc73684dc95521 100644 --- a/folly/lang/PropagateConst.h +++ b/folly/lang/PropagateConst.h @@ -69,39 +69,39 @@ class propagate_const { template < typename OtherPointer, - _t<std::enable_if< + std::enable_if_t< std::is_constructible<Pointer, OtherPointer&&>::value && !std::is_convertible<OtherPointer&&, Pointer>::value, - int>> = 0> + int> = 0> constexpr explicit propagate_const(propagate_const<OtherPointer>&& other) : pointer_(static_cast<OtherPointer&&>(other.pointer_)) {} template < typename OtherPointer, - _t<std::enable_if< + std::enable_if_t< std::is_constructible<Pointer, OtherPointer&&>::value && std::is_convertible<OtherPointer&&, Pointer>::value, - int>> = 0> + int> = 0> constexpr propagate_const(propagate_const<OtherPointer>&& other) : pointer_(static_cast<OtherPointer&&>(other.pointer_)) {} template < typename OtherPointer, - _t<std::enable_if< + std::enable_if_t< !detail::is_decay_propagate_const<OtherPointer>::value && std::is_constructible<Pointer, OtherPointer&&>::value && !std::is_convertible<OtherPointer&&, Pointer>::value, - int>> = 0> + int> = 0> constexpr explicit propagate_const(OtherPointer&& other) : pointer_(static_cast<OtherPointer&&>(other)) {} template < typename OtherPointer, - _t<std::enable_if< + std::enable_if_t< !detail::is_decay_propagate_const<OtherPointer>::value && std::is_constructible<Pointer, OtherPointer&&>::value && std::is_convertible<OtherPointer&&, Pointer>::value, - int>> = 0> + int> = 0> constexpr propagate_const(OtherPointer&& other) : pointer_(static_cast<OtherPointer&&>(other)) {} @@ -119,9 +119,9 @@ class propagate_const { template < typename OtherPointer, - typename = _t<std::enable_if< + typename = std::enable_if_t< !detail::is_decay_propagate_const<OtherPointer>::value && - std::is_convertible<OtherPointer&&, Pointer>::value>>> + std::is_convertible<OtherPointer&&, Pointer>::value>> FOLLY_CPP14_CONSTEXPR propagate_const& operator=(OtherPointer&& other) { pointer_ = static_cast<OtherPointer&&>(other); return *this; @@ -164,18 +164,18 @@ class propagate_const { template < typename OtherPointer = Pointer, - typename = _t<std::enable_if< + typename = std::enable_if_t< std::is_pointer<OtherPointer>::value || - std::is_convertible<OtherPointer, element_type*>::value>>> + std::is_convertible<OtherPointer, element_type*>::value>> FOLLY_CPP14_CONSTEXPR operator element_type*() { return get(); } template < typename OtherPointer = Pointer, - typename = _t<std::enable_if< + typename = std::enable_if_t< std::is_pointer<OtherPointer>::value || - std::is_convertible<OtherPointer, element_type const*>::value>>> + std::is_convertible<OtherPointer, element_type const*>::value>> constexpr operator element_type const*() const { return get(); } diff --git a/folly/stats/Histogram.h b/folly/stats/Histogram.h index b01b081515ebd862acd058e87f60b330322634b4..3aaa5ee5526bf2278091c9ad211d4c3103e8d4dd 100644 --- a/folly/stats/Histogram.h +++ b/folly/stats/Histogram.h @@ -472,15 +472,13 @@ class Histogram { }; private: - template < - typename S, - typename = _t<std::enable_if<std::is_integral<S>::value>>> + template <typename S, typename = std::enable_if_t<std::is_integral<S>::value>> static constexpr _t<std::make_unsigned<S>> to_unsigned(S s) { return static_cast<_t<std::make_unsigned<S>>>(s); } template < typename S, - typename = _t<std::enable_if<!std::is_integral<S>::value>>> + typename = std::enable_if_t<!std::is_integral<S>::value>> static constexpr S to_unsigned(S s) { return s; }