summaryrefslogtreecommitdiffstats
path: root/googletest/include/gtest
diff options
context:
space:
mode:
authorkuzkry <krystian.kuzniarek@gmail.com>2019-08-29 18:38:09 (GMT)
committerGennadiy Rozental <rogeeff@google.com>2019-09-06 12:00:03 (GMT)
commitab8f346b076f76f7770f33437fb5823fa444cb80 (patch)
tree35ce84e546aab767ce0a650e39c0600c16629e0f /googletest/include/gtest
parent565f1b848215b77c3732bca345fe76a0431d8b34 (diff)
downloadgoogletest-ab8f346b076f76f7770f33437fb5823fa444cb80.zip
googletest-ab8f346b076f76f7770f33437fb5823fa444cb80.tar.gz
googletest-ab8f346b076f76f7770f33437fb5823fa444cb80.tar.bz2
Googletest export
Merge 7f4f58da20e1066a888d3e4bcbef541db798a605 into 90a443f9c2437ca8a682a1ac625eba64e1d74a8a Closes #2395 COPYBARA_INTEGRATE_REVIEW=https://github.com/google/googletest/pull/2395 from kuzkry:custom-type-traits-remove_reference 7f4f58da20e1066a888d3e4bcbef541db798a605 PiperOrigin-RevId: 266189044
Diffstat (limited to 'googletest/include/gtest')
-rw-r--r--googletest/include/gtest/internal/gtest-internal.h18
1 files changed, 2 insertions, 16 deletions
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h
index 37daf21..3a98ce4 100644
--- a/googletest/include/gtest/internal/gtest-internal.h
+++ b/googletest/include/gtest/internal/gtest-internal.h
@@ -856,30 +856,16 @@ template <typename T>
struct CompileAssertTypesEqual<T, T> {
};
-// Removes the reference from a type if it is a reference type,
-// otherwise leaves it unchanged. This is the same as
-// tr1::remove_reference, which is not widely available yet.
-template <typename T>
-struct RemoveReference { typedef T type; }; // NOLINT
-template <typename T>
-struct RemoveReference<T&> { typedef T type; }; // NOLINT
-
-// A handy wrapper around RemoveReference that works when the argument
-// T depends on template parameters.
-#define GTEST_REMOVE_REFERENCE_(T) \
- typename ::testing::internal::RemoveReference<T>::type
-
// Turns const U&, U&, const U, and U all into U.
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
- typename std::remove_const<GTEST_REMOVE_REFERENCE_(T)>::type
+ typename std::remove_const<typename std::remove_reference<T>::type>::type
// IsAProtocolMessage<T>::value is a compile-time bool constant that's
// true if T is type proto2::Message or a subclass of it.
template <typename T>
struct IsAProtocolMessage
: public bool_constant<
- std::is_convertible<const T*, const ::proto2::Message*>::value> {
-};
+ std::is_convertible<const T*, const ::proto2::Message*>::value> {};
// When the compiler sees expression IsContainerTest<C>(0), if C is an
// STL-style container class, the first overload of IsContainerTest