mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 1625138 - Part 6: Replace mozilla::IsClass with std::is_class. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68360 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
e7d63cc0a3
commit
086c1b8be3
@ -253,29 +253,6 @@ struct IsEnumHelper : IntegralConstant<bool, __is_enum(T)> {};
|
||||
template <typename T>
|
||||
struct IsEnum : detail::IsEnumHelper<typename RemoveCV<T>::Type> {};
|
||||
|
||||
namespace detail {
|
||||
|
||||
// __is_class is a supported extension across all of our supported compilers:
|
||||
// http://llvm.org/releases/3.0/docs/ClangReleaseNotes.html
|
||||
// http://gcc.gnu.org/onlinedocs/gcc-4.4.7/gcc/Type-Traits.html#Type-Traits
|
||||
// http://msdn.microsoft.com/en-us/library/ms177194%28v=vs.100%29.aspx
|
||||
template <typename T>
|
||||
struct IsClassHelper : IntegralConstant<bool, __is_class(T)> {};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
/**
|
||||
* IsClass determines whether a type is a class type (but not a union).
|
||||
*
|
||||
* struct S {};
|
||||
* union U {};
|
||||
* mozilla::IsClass<int>::value is false;
|
||||
* mozilla::IsClass<const S>::value is true;
|
||||
* mozilla::IsClass<U>::value is false;
|
||||
*/
|
||||
template <typename T>
|
||||
struct IsClass : detail::IsClassHelper<typename RemoveCV<T>::Type> {};
|
||||
|
||||
/* 20.9.4.2 Composite type traits [meta.unary.comp] */
|
||||
|
||||
/**
|
||||
|
@ -16,7 +16,6 @@ using mozilla::AddRvalueReference;
|
||||
using mozilla::Decay;
|
||||
using mozilla::DeclVal;
|
||||
using mozilla::IsArray;
|
||||
using mozilla::IsClass;
|
||||
using mozilla::IsConvertible;
|
||||
using mozilla::IsDestructible;
|
||||
using mozilla::IsFunction;
|
||||
@ -126,15 +125,6 @@ TEST_IS_NOT_SCALAR(U)
|
||||
|
||||
} // namespace CPlusPlus11IsScalar
|
||||
|
||||
struct S1 {};
|
||||
union U1 {
|
||||
int mX;
|
||||
};
|
||||
|
||||
static_assert(!IsClass<int>::value, "int isn't a class");
|
||||
static_assert(IsClass<const S1>::value, "S is a class");
|
||||
static_assert(!IsClass<U1>::value, "U isn't a class");
|
||||
|
||||
static_assert(!IsSigned<bool>::value, "bool shouldn't be signed");
|
||||
static_assert(IsUnsigned<bool>::value, "bool should be unsigned");
|
||||
|
||||
|
@ -89,9 +89,8 @@ class nsAutoOwningThread {
|
||||
|
||||
# define NS_LOG_RELEASE(_p, _rc, _type) NS_LogRelease((_p), (_rc), (_type))
|
||||
|
||||
# include "mozilla/TypeTraits.h"
|
||||
# define MOZ_ASSERT_CLASSNAME(_type) \
|
||||
static_assert(mozilla::IsClass<_type>::value, \
|
||||
# define MOZ_ASSERT_CLASSNAME(_type) \
|
||||
static_assert(std::is_class_v<_type>, \
|
||||
"Token '" #_type "' is not a class type.")
|
||||
|
||||
# define MOZ_ASSERT_NOT_ISUPPORTS(_type) \
|
||||
|
Loading…
Reference in New Issue
Block a user