Electroneum
testing::internal::RefMatcher< T & > Class Template Reference

#include <gmock-matchers.h>

Public Member Functions

 RefMatcher (T &x)
 
template<typename Super >
 operator Matcher< Super & > () const
 

Detailed Description

template<typename T>
class testing::internal::RefMatcher< T & >

Definition at line 1032 of file gmock-matchers.h.

Constructor & Destructor Documentation

◆ RefMatcher()

template<typename T >
testing::internal::RefMatcher< T & >::RefMatcher ( T x)
inlineexplicit

Definition at line 1042 of file gmock-matchers.h.

1042 : object_(x) {} // NOLINT

Member Function Documentation

◆ operator Matcher< Super & >()

template<typename T >
template<typename Super >
testing::internal::RefMatcher< T & >::operator Matcher< Super &> ( ) const
inline

Definition at line 1045 of file gmock-matchers.h.

1045  {
1046  // By passing object_ (type T&) to Impl(), which expects a Super&,
1047  // we make sure that Super is a super type of T. In particular,
1048  // this catches using Ref(const_value) as a matcher for a
1049  // non-const reference, as you cannot implicitly convert a const
1050  // reference to a non-const reference.
1051  return MakeMatcher(new Impl<Super>(object_));
1052  }
Matcher< T > MakeMatcher(const MatcherInterface< T > *impl)
Here is the call graph for this function:

The documentation for this class was generated from the following file: