Googletest export
Merge 7f4f58da20e1066a888d3e4bcbef541db798a605 into 90a443f9c2
Closes #2395
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/googletest/pull/2395 from kuzkry:custom-type-traits-remove_reference 7f4f58da20e1066a888d3e4bcbef541db798a605
PiperOrigin-RevId: 266189044
This commit is contained in:
committed by
Gennadiy Rozental
parent
565f1b8482
commit
ab8f346b07
@@ -1607,9 +1607,8 @@ class PointeeMatcher {
|
||||
template <typename Pointer>
|
||||
class Impl : public MatcherInterface<Pointer> {
|
||||
public:
|
||||
typedef
|
||||
typename PointeeOf<typename std::remove_const<GTEST_REMOVE_REFERENCE_(
|
||||
Pointer)>::type>::type Pointee;
|
||||
typedef typename PointeeOf<typename std::remove_const<
|
||||
typename std::remove_reference<Pointer>::type>::type>::type Pointee;
|
||||
|
||||
explicit Impl(const InnerMatcher& matcher)
|
||||
: matcher_(MatcherCast<const Pointee&>(matcher)) {}
|
||||
|
||||
@@ -1320,8 +1320,8 @@ class ReferenceOrValueWrapper {
|
||||
|
||||
// Provides nondestructive access to the underlying value/reference.
|
||||
// Always returns a const reference (more precisely,
|
||||
// const RemoveReference<T>&). The behavior of calling this after
|
||||
// calling Unwrap on the same object is unspecified.
|
||||
// const std::add_lvalue_reference<T>::type). The behavior of calling this
|
||||
// after calling Unwrap on the same object is unspecified.
|
||||
const T& Peek() const {
|
||||
return value_;
|
||||
}
|
||||
|
||||
@@ -336,10 +336,6 @@ GTEST_API_ WithoutMatchers GetWithoutMatchers();
|
||||
|
||||
// Type traits.
|
||||
|
||||
// remove_reference<T>::type removes the reference from type T, if any.
|
||||
template <typename T> struct remove_reference { typedef T type; }; // NOLINT
|
||||
template <typename T> struct remove_reference<T&> { typedef T type; }; // NOLINT
|
||||
|
||||
// Disable MSVC warnings for infinite recursion, since in this case the
|
||||
// the recursion is unreachable.
|
||||
#ifdef _MSC_VER
|
||||
|
||||
Reference in New Issue
Block a user