зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1625138 - Part 10: Replace mozilla::IsEnum with std::is_enum. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68364 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
aae2042c40
Коммит
4ac8916451
|
@ -24,6 +24,7 @@
|
|||
#include <atomic>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <type_traits>
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -447,7 +448,7 @@ class Atomic<T*, Order> : public detail::AtomicBaseIncDec<T*, Order> {
|
|||
* The atomic store and load operations and the atomic swap method is provided.
|
||||
*/
|
||||
template <typename T, MemoryOrdering Order>
|
||||
class Atomic<T, Order, typename EnableIf<IsEnum<T>::value>::Type>
|
||||
class Atomic<T, Order, typename EnableIf<std::is_enum_v<T>>::Type>
|
||||
: public detail::AtomicBase<T, Order> {
|
||||
typedef typename detail::AtomicBase<T, Order> Base;
|
||||
|
||||
|
|
|
@ -235,24 +235,6 @@ struct IsPointerHelper<T*> : TrueType {};
|
|||
template <typename T>
|
||||
struct IsPointer : detail::IsPointerHelper<typename RemoveCV<T>::Type> {};
|
||||
|
||||
namespace detail {
|
||||
|
||||
// __is_enum is a supported extension across all of our supported compilers.
|
||||
template <typename T>
|
||||
struct IsEnumHelper : IntegralConstant<bool, __is_enum(T)> {};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
/**
|
||||
* IsEnum determines whether a type is an enum type.
|
||||
*
|
||||
* mozilla::IsEnum<enum S>::value is true;
|
||||
* mozilla::IsEnum<enum S*>::value is false;
|
||||
* mozilla::IsEnum<int>::value is false;
|
||||
*/
|
||||
template <typename T>
|
||||
struct IsEnum : detail::IsEnumHelper<typename RemoveCV<T>::Type> {};
|
||||
|
||||
/* 20.9.4.3 Type properties [meta.unary.prop] */
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче