Bug 1625138 - Part 39: Replace mozilla::IsSame with std::is_same in gfx/. r=froydnj

Differential Revision: https://phabricator.services.mozilla.com/D68558

--HG--
extra : moz-landing-system : lando
This commit is contained in:
André Bargull 2020-03-28 13:57:21 +00:00
parent 73a498ec0c
commit 62ab594247
4 changed files with 15 additions and 14 deletions

View File

@ -97,7 +97,7 @@ struct BasePoint {
// "Finite" means not inf and not NaN
bool IsFinite() const {
using FloatType =
std::conditional_t<mozilla::IsSame<T, float>::value, float, double>;
std::conditional_t<std::is_same_v<T, float>, float, double>;
return (mozilla::IsFinite(FloatType(x)) && mozilla::IsFinite(FloatType(y)));
return true;
}

View File

@ -66,7 +66,7 @@ struct BaseRect {
// "Finite" means not inf and not NaN
bool IsFinite() const {
using FloatType =
std::conditional_t<mozilla::IsSame<T, float>::value, float, double>;
std::conditional_t<std::is_same_v<T, float>, float, double>;
return (mozilla::IsFinite(FloatType(x)) &&
mozilla::IsFinite(FloatType(y)) &&
mozilla::IsFinite(FloatType(width)) &&

View File

@ -13,6 +13,7 @@
#include "BaseCoord.h"
#include <cmath>
#include <type_traits>
namespace mozilla {
@ -104,13 +105,13 @@ struct IntCoordTyped
template <class units, class F>
struct CoordTyped : public BaseCoord<F, CoordTyped<units, F> >,
public CoordOperatorsHelper<!IsSame<F, int32_t>::value,
public CoordOperatorsHelper<!std::is_same_v<F, int32_t>,
CoordTyped<units, F>, int32_t>,
public CoordOperatorsHelper<!IsSame<F, uint32_t>::value,
public CoordOperatorsHelper<!std::is_same_v<F, uint32_t>,
CoordTyped<units, F>, uint32_t>,
public CoordOperatorsHelper<!IsSame<F, double>::value,
public CoordOperatorsHelper<!std::is_same_v<F, double>,
CoordTyped<units, F>, double>,
public CoordOperatorsHelper<!IsSame<F, float>::value,
public CoordOperatorsHelper<!std::is_same_v<F, float>,
CoordTyped<units, F>, float> {
static_assert(IsPixel<units>::value,
"'units' must be a coordinate system tag");

View File

@ -89,8 +89,8 @@ template <typename Iterator, typename Node, typename PreAction,
static auto ForEachNode(Node aRoot, const PreAction& aPreAction,
const PostAction& aPostAction)
-> std::enable_if_t<
IsSame<decltype(aPreAction(aRoot)), TraversalFlag>::value &&
IsSame<decltype(aPostAction(aRoot)), TraversalFlag>::value,
std::is_same_v<decltype(aPreAction(aRoot)), TraversalFlag> &&
std::is_same_v<decltype(aPostAction(aRoot)), TraversalFlag>,
bool> {
if (!aRoot) {
return false;
@ -129,8 +129,8 @@ template <typename Iterator, typename Node, typename PreAction,
typename PostAction>
static auto ForEachNode(Node aRoot, const PreAction& aPreAction,
const PostAction& aPostAction)
-> std::enable_if_t<IsSame<decltype(aPreAction(aRoot)), void>::value &&
IsSame<decltype(aPostAction(aRoot)), void>::value,
-> std::enable_if_t<std::is_same_v<decltype(aPreAction(aRoot)), void> &&
std::is_same_v<decltype(aPostAction(aRoot)), void>,
void> {
if (!aRoot) {
return;
@ -151,7 +151,7 @@ static auto ForEachNode(Node aRoot, const PreAction& aPreAction,
*/
template <typename Iterator, typename Node, typename PreAction>
auto ForEachNode(Node aRoot, const PreAction& aPreAction) -> std::enable_if_t<
IsSame<decltype(aPreAction(aRoot)), TraversalFlag>::value, bool> {
std::is_same_v<decltype(aPreAction(aRoot)), TraversalFlag>, bool> {
return ForEachNode<Iterator>(
aRoot, aPreAction, [](Node aNode) { return TraversalFlag::Continue; });
}
@ -161,7 +161,7 @@ auto ForEachNode(Node aRoot, const PreAction& aPreAction) -> std::enable_if_t<
*/
template <typename Iterator, typename Node, typename PreAction>
auto ForEachNode(Node aRoot, const PreAction& aPreAction)
-> std::enable_if_t<IsSame<decltype(aPreAction(aRoot)), void>::value,
-> std::enable_if_t<std::is_same_v<decltype(aPreAction(aRoot)), void>,
void> {
ForEachNode<Iterator>(aRoot, aPreAction, [](Node aNode) {});
}
@ -172,7 +172,7 @@ auto ForEachNode(Node aRoot, const PreAction& aPreAction)
template <typename Iterator, typename Node, typename PostAction>
auto ForEachNodePostOrder(Node aRoot, const PostAction& aPostAction)
-> std::enable_if_t<
IsSame<decltype(aPostAction(aRoot)), TraversalFlag>::value, bool> {
std::is_same_v<decltype(aPostAction(aRoot)), TraversalFlag>, bool> {
return ForEachNode<Iterator>(
aRoot, [](Node aNode) { return TraversalFlag::Continue; }, aPostAction);
}
@ -182,7 +182,7 @@ auto ForEachNodePostOrder(Node aRoot, const PostAction& aPostAction)
*/
template <typename Iterator, typename Node, typename PostAction>
auto ForEachNodePostOrder(Node aRoot, const PostAction& aPostAction)
-> std::enable_if_t<IsSame<decltype(aPostAction(aRoot)), void>::value,
-> std::enable_if_t<std::is_same_v<decltype(aPostAction(aRoot)), void>,
void> {
ForEachNode<Iterator>(
aRoot, [](Node aNode) {}, aPostAction);