From 11471da7938bb414a5739e292ccc71f18966068f Mon Sep 17 00:00:00 2001 From: Krystian Kuzniarek Date: Tue, 13 Aug 2019 23:35:11 +0200 Subject: remove a custom implementation of std::enable_if --- googletest/include/gtest/gtest-matchers.h | 12 +++++++----- googletest/include/gtest/gtest.h | 2 +- googletest/include/gtest/internal/gtest-internal.h | 7 ------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/googletest/include/gtest/gtest-matchers.h b/googletest/include/gtest/gtest-matchers.h index 7711178..5eb0a4e 100644 --- a/googletest/include/gtest/gtest-matchers.h +++ b/googletest/include/gtest/gtest-matchers.h @@ -42,6 +42,7 @@ #include #include #include +#include #include "gtest/gtest-printers.h" #include "gtest/internal/gtest-internal.h" @@ -299,8 +300,8 @@ class MatcherBase { template explicit MatcherBase( const MatcherInterface* impl, - typename internal::EnableIf< - !internal::IsSame::value>::type* = nullptr) + typename std::enable_if::value>::type* = + nullptr) : impl_(new internal::MatcherInterfaceAdapter(impl)) {} MatcherBase(const MatcherBase&) = default; @@ -333,9 +334,10 @@ class Matcher : public internal::MatcherBase { : internal::MatcherBase(impl) {} template - explicit Matcher(const MatcherInterface* impl, - typename internal::EnableIf< - !internal::IsSame::value>::type* = nullptr) + explicit Matcher( + const MatcherInterface* impl, + typename std::enable_if::value>::type* = + nullptr) : internal::MatcherBase(impl) {} // Implicit constructor here allows people to write diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h index db81359..dfe7c78 100644 --- a/googletest/include/gtest/gtest.h +++ b/googletest/include/gtest/gtest.h @@ -292,7 +292,7 @@ class GTEST_API_ AssertionResult { template explicit AssertionResult( const T& success, - typename internal::EnableIf< + typename std::enable_if< !std::is_convertible::value>::type* /*enabler*/ = nullptr) diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index 08531d8..8b05062 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -991,13 +991,6 @@ struct IsRecursiveContainerImpl { template struct IsRecursiveContainer : public IsRecursiveContainerImpl::type {}; -// EnableIf::type is void when 'Cond' is true, and -// undefined when 'Cond' is false. To use SFINAE to make a function -// overload only apply when a particular expression is true, add -// "typename EnableIf::type* = 0" as the last parameter. -template struct EnableIf; -template<> struct EnableIf { typedef void type; }; // NOLINT - // Utilities for native arrays. // ArrayEq() compares two k-dimensional native arrays using the -- cgit v0.12