diff --git a/mfbt/TypeTraits.h b/mfbt/TypeTraits.h index 681edaa1fe2b..2e9a8821e4aa 100644 --- a/mfbt/TypeTraits.h +++ b/mfbt/TypeTraits.h @@ -288,19 +288,6 @@ template struct IsMemberPointer : detail::IsMemberPointerHelper::Type> {}; -/** - * IsScalar determines whether a type is a scalar type. - * - * mozilla::IsScalar::value is true - * mozilla::IsScalar::value is true - * mozilla::IsScalar::value is false - */ -template -struct IsScalar - : IntegralConstant::value || IsEnum::value || - IsPointer::value || - IsMemberPointer::value> {}; - /* 20.9.4.3 Type properties [meta.unary.prop] */ /** diff --git a/mfbt/tests/TestTypeTraits.cpp b/mfbt/tests/TestTypeTraits.cpp index 053a8baadf7b..d2825df0e842 100644 --- a/mfbt/tests/TestTypeTraits.cpp +++ b/mfbt/tests/TestTypeTraits.cpp @@ -86,45 +86,6 @@ TEST_IS_NOT_MEMBER_POINTER(int*) } // namespace CPlusPlus11IsMemberPointer -namespace CPlusPlus11IsScalar { - -using mozilla::IsScalar; - -enum E {}; -enum class EC {}; -class C {}; -struct S {}; -union U {}; - -#define ASSERT_IS_SCALAR(type, msg) \ - static_assert(IsScalar::value, #type msg); -#define TEST_IS_SCALAR(type) \ - TEST_CV_QUALIFIERS(ASSERT_IS_SCALAR, type, " is a scalar type") - -TEST_IS_SCALAR(int) -TEST_IS_SCALAR(float) -TEST_IS_SCALAR(E) -TEST_IS_SCALAR(EC) -TEST_IS_SCALAR(S*) -TEST_IS_SCALAR(int S::*) - -#undef TEST_IS_SCALAR -#undef ASSERT_IS_SCALAR - -#define ASSERT_IS_NOT_SCALAR(type, msg) \ - static_assert(!IsScalar::value, #type msg); -#define TEST_IS_NOT_SCALAR(type) \ - TEST_CV_QUALIFIERS(ASSERT_IS_NOT_SCALAR, type, " is not a scalar type") - -TEST_IS_NOT_SCALAR(C) -TEST_IS_NOT_SCALAR(S) -TEST_IS_NOT_SCALAR(U) - -#undef TEST_IS_NOT_SCALAR -#undef ASSERT_IS_NOT_SCALAR - -} // namespace CPlusPlus11IsScalar - static_assert(!IsSigned::value, "bool shouldn't be signed"); static_assert(IsUnsigned::value, "bool should be unsigned"); diff --git a/xpcom/base/nsAutoPtr.h b/xpcom/base/nsAutoPtr.h index eefab7294c38..7a0d557b5f1e 100644 --- a/xpcom/base/nsAutoPtr.h +++ b/xpcom/base/nsAutoPtr.h @@ -7,9 +7,10 @@ #ifndef nsAutoPtr_h #define nsAutoPtr_h +#include + #include "nsCOMPtr.h" #include "mozilla/RefPtr.h" -#include "mozilla/TypeTraits.h" #include "nsCycleCollectionNoteChild.h" #include "mozilla/MemoryReporting.h" @@ -21,7 +22,7 @@ template class nsAutoPtr { private: - static_assert(!mozilla::IsScalar::value, + static_assert(!std::is_scalar_v, "If you are using " "nsAutoPtr to hold an array, use UniquePtr instead");