From ec49fbca4cb84651fb2eae5d093d0342f356cf29 Mon Sep 17 00:00:00 2001 From: Krystian Kuzniarek Date: Tue, 13 Aug 2019 22:30:12 +0200 Subject: remove custom implementations of std::is_same --- googlemock/include/gmock/gmock-spec-builders.h | 6 +++--- .../include/gmock/internal/gmock-internal-utils.h | 4 ---- googlemock/test/gmock-internal-utils_test.cc | 18 ++++++------------ googlemock/test/gmock-matchers_test.cc | 2 +- 4 files changed, 10 insertions(+), 20 deletions(-) (limited to 'googlemock') diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h index 735a3bcb..0d1adda5 100644 --- a/googlemock/include/gmock/gmock-spec-builders.h +++ b/googlemock/include/gmock/gmock-spec-builders.h @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include "gmock/gmock-actions.h" @@ -1653,9 +1654,8 @@ class FunctionMocker final : public UntypedFunctionMockerBase { const OnCallSpec* const spec = FindOnCallSpec(args); if (spec == nullptr) { - *os << (internal::type_equals::value ? - "returning directly.\n" : - "returning default value.\n"); + *os << (std::is_void::value ? "returning directly.\n" + : "returning default value.\n"); } else { *os << "taking default action specified at:\n" << FormatFileLocation(spec->file(), spec->line()) << "\n"; diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index ee004790..7bfa54c0 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -359,10 +359,6 @@ GTEST_API_ WithoutMatchers GetWithoutMatchers(); template struct is_reference : public false_type {}; template struct is_reference : public true_type {}; -// type_equals::value is non-zero if T1 and T2 are the same type. -template struct type_equals : public false_type {}; -template struct type_equals : public true_type {}; - // remove_reference::type removes the reference from type T, if any. template struct remove_reference { typedef T type; }; // NOLINT template struct remove_reference { typedef T type; }; // NOLINT diff --git a/googlemock/test/gmock-internal-utils_test.cc b/googlemock/test/gmock-internal-utils_test.cc index a76e777c..cee13e90 100644 --- a/googlemock/test/gmock-internal-utils_test.cc +++ b/googlemock/test/gmock-internal-utils_test.cc @@ -38,6 +38,7 @@ #include #include #include +#include #include #include "gmock/gmock.h" #include "gmock/internal/gmock-port.h" @@ -518,19 +519,12 @@ TEST(TypeTraitsTest, is_reference) { EXPECT_TRUE(is_reference::value); } -TEST(TypeTraitsTest, type_equals) { - EXPECT_FALSE((type_equals::value)); - EXPECT_FALSE((type_equals::value)); - EXPECT_FALSE((type_equals::value)); - EXPECT_TRUE((type_equals::value)); -} - TEST(TypeTraitsTest, remove_reference) { - EXPECT_TRUE((type_equals::type>::value)); - EXPECT_TRUE((type_equals::type>::value)); - EXPECT_TRUE((type_equals::type>::value)); - EXPECT_TRUE((type_equals::type>::value)); + EXPECT_TRUE((std::is_same::type>::value)); + EXPECT_TRUE( + (std::is_same::type>::value)); + EXPECT_TRUE((std::is_same::type>::value)); + EXPECT_TRUE((std::is_same::type>::value)); } #if GTEST_HAS_STREAM_REDIRECTION diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc index 74e9294f..a61d040b 100644 --- a/googlemock/test/gmock-matchers_test.cc +++ b/googlemock/test/gmock-matchers_test.cc @@ -6434,7 +6434,7 @@ class SampleVariantIntString { template friend bool holds_alternative(const SampleVariantIntString& value) { - return value.has_int_ == internal::IsSame::value; + return value.has_int_ == std::is_same::value; } template -- cgit v1.2.3