From da76d01b984fcfd02cf7b368b6081c988937f336 Mon Sep 17 00:00:00 2001 From: Krystian Kuzniarek Date: Wed, 14 Aug 2019 13:33:13 +0200 Subject: remove a custom implementation of std::is_reference --- googlemock/include/gmock/gmock-actions.h | 8 ++++---- googlemock/include/gmock/gmock-matchers.h | 2 +- googlemock/include/gmock/gmock-more-actions.h | 2 +- googlemock/include/gmock/internal/gmock-internal-utils.h | 4 ---- 4 files changed, 6 insertions(+), 10 deletions(-) (limited to 'googlemock/include/gmock') diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index e921cf4a..9605c43a 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -532,7 +532,7 @@ class ReturnAction { // in the Impl class. But both definitions must be the same. typedef typename Function::Result Result; GTEST_COMPILE_ASSERT_( - !is_reference::value, + !std::is_reference::value, use_ReturnRef_instead_of_Return_to_return_a_reference); static_assert(!std::is_void::value, "Can't use Return() on an action expected to return `void`."); @@ -561,7 +561,7 @@ class ReturnAction { Result Perform(const ArgumentTuple&) override { return value_; } private: - GTEST_COMPILE_ASSERT_(!is_reference::value, + GTEST_COMPILE_ASSERT_(!std::is_reference::value, Result_cannot_be_a_reference_type); // We save the value before casting just in case it is being cast to a // wrapper type. @@ -640,7 +640,7 @@ class ReturnRefAction { // Asserts that the function return type is a reference. This // catches the user error of using ReturnRef(x) when Return(x) // should be used, and generates some helpful error message. - GTEST_COMPILE_ASSERT_(internal::is_reference::value, + GTEST_COMPILE_ASSERT_(std::is_reference::value, use_Return_instead_of_ReturnRef_to_return_a_value); return Action(new Impl(ref_)); } @@ -687,7 +687,7 @@ class ReturnRefOfCopyAction { // catches the user error of using ReturnRefOfCopy(x) when Return(x) // should be used, and generates some helpful error message. GTEST_COMPILE_ASSERT_( - internal::is_reference::value, + std::is_reference::value, use_Return_instead_of_ReturnRefOfCopy_to_return_a_value); return Action(new Impl(value_)); } diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 70750827..874151b7 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -280,7 +280,7 @@ class SafeMatcherCastImpl { // Enforce that we are not converting a non-reference type T to a reference // type U. GTEST_COMPILE_ASSERT_( - internal::is_reference::value || !internal::is_reference::value, + std::is_reference::value || !std::is_reference::value, cannot_convert_non_reference_arg_to_reference); // In case both T and U are arithmetic types, enforce that the // conversion is not lossy. diff --git a/googlemock/include/gmock/gmock-more-actions.h b/googlemock/include/gmock/gmock-more-actions.h index a052495d..d42484ae 100644 --- a/googlemock/include/gmock/gmock-more-actions.h +++ b/googlemock/include/gmock/gmock-more-actions.h @@ -105,7 +105,7 @@ ACTION_TEMPLATE(SetArgReferee, // Ensures that argument #k is a reference. If you get a compiler // error on the next line, you are using SetArgReferee(value) in // a mock function whose k-th (0-based) argument is not a reference. - GTEST_COMPILE_ASSERT_(internal::is_reference::value, + GTEST_COMPILE_ASSERT_(std::is_reference::value, SetArgReferee_must_be_used_with_a_reference_argument); ::std::get(args) = value; } diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index ee004790..b7d2cf24 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -355,10 +355,6 @@ GTEST_API_ WithoutMatchers GetWithoutMatchers(); // Type traits. -// is_reference::value is non-zero if T is a reference type. -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 {}; -- cgit v1.2.3