зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1607826 - Use <type_traits> more in layout. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D59160 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
f30bbdcc73
Коммит
16b2bfd512
|
@ -10,7 +10,6 @@
|
|||
#define nsGridContainerFrame_h___
|
||||
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
#include "mozilla/HashTable.h"
|
||||
#include "nsContainerFrame.h"
|
||||
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
#ifndef nsQueryFrame_h
|
||||
#define nsQueryFrame_h
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include "nscore.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
|
||||
// NOTE: the long lines in this file are intentional to make compiler error
|
||||
// messages more readable.
|
||||
|
@ -126,9 +127,8 @@ class do_QueryFrameHelper {
|
|||
// downcasting is safe.
|
||||
template <class Src, class Dst>
|
||||
struct FastQueryFrame<
|
||||
Src, Dst,
|
||||
typename mozilla::EnableIf<std::is_base_of<nsIFrame, Src>::value>::Type,
|
||||
typename mozilla::EnableIf<std::is_base_of<nsIFrame, Dst>::value>::Type> {
|
||||
Src, Dst, std::enable_if_t<std::is_base_of<nsIFrame, Src>::value>,
|
||||
std::enable_if_t<std::is_base_of<nsIFrame, Dst>::value>> {
|
||||
static Dst* QueryFrame(Src* aFrame) {
|
||||
return nsQueryFrame::FrameIID(aFrame->mClass) == Dst::kFrameIID
|
||||
? reinterpret_cast<Dst*>(aFrame)
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#define mozilla_ServoUtils_h
|
||||
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
#include "MainThreadUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
|
|
@ -105,8 +105,7 @@ class nsCSSValue {
|
|||
nsCSSValue(nsCSSValue&& aOther) : mUnit(aOther.mUnit), mValue(aOther.mValue) {
|
||||
aOther.mUnit = eCSSUnit_Null;
|
||||
}
|
||||
template <typename T,
|
||||
typename = typename std::enable_if<std::is_enum<T>::value>::type>
|
||||
template <typename T, typename = std::enable_if_t<std::is_enum<T>::value>>
|
||||
explicit nsCSSValue(T aValue) : mUnit(eCSSUnit_Enumerated) {
|
||||
static_assert(mozilla::EnumTypeFitsWithin<T, int32_t>::value,
|
||||
"aValue must be an enum that fits within mValue.mInt");
|
||||
|
@ -193,8 +192,7 @@ class nsCSSValue {
|
|||
|
||||
public:
|
||||
void SetIntValue(int32_t aValue, nsCSSUnit aUnit);
|
||||
template <typename T,
|
||||
typename = typename std::enable_if<std::is_enum<T>::value>::type>
|
||||
template <typename T, typename = std::enable_if_t<std::is_enum<T>::value>>
|
||||
void SetEnumValue(T aValue) {
|
||||
static_assert(mozilla::EnumTypeFitsWithin<T, int32_t>::value,
|
||||
"aValue must be an enum that fits within mValue.mInt");
|
||||
|
|
Загрузка…
Ссылка в новой задаче