proxygen
testing::internal::MatcherAsPredicate< M > Class Template Reference

#include <gmock-matchers.h>

Public Member Functions

 MatcherAsPredicate (M matcher)
 
template<typename T >
bool operator() (const T &x) const
 
 MatcherAsPredicate (M matcher)
 
template<typename T >
bool operator() (const T &x) const
 
 MatcherAsPredicate (M matcher)
 
template<typename T >
bool operator() (const T &x) const
 

Private Member Functions

 GTEST_DISALLOW_ASSIGN_ (MatcherAsPredicate)
 
 GTEST_DISALLOW_ASSIGN_ (MatcherAsPredicate)
 
 GTEST_DISALLOW_ASSIGN_ (MatcherAsPredicate)
 

Private Attributes

M matcher_
 

Detailed Description

template<typename M>
class testing::internal::MatcherAsPredicate< M >

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

Constructor & Destructor Documentation

template<typename M >
testing::internal::MatcherAsPredicate< M >::MatcherAsPredicate ( M  matcher)
inlineexplicit

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

template<typename M >
testing::internal::MatcherAsPredicate< M >::MatcherAsPredicate ( M  matcher)
inlineexplicit

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

template<typename M >
testing::internal::MatcherAsPredicate< M >::MatcherAsPredicate ( M  matcher)
inlineexplicit

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

Member Function Documentation

template<typename M >
testing::internal::MatcherAsPredicate< M >::GTEST_DISALLOW_ASSIGN_ ( MatcherAsPredicate< M )
private
template<typename M >
testing::internal::MatcherAsPredicate< M >::GTEST_DISALLOW_ASSIGN_ ( MatcherAsPredicate< M )
private
template<typename M >
testing::internal::MatcherAsPredicate< M >::GTEST_DISALLOW_ASSIGN_ ( MatcherAsPredicate< M )
private
template<typename M >
template<typename T >
bool testing::internal::MatcherAsPredicate< M >::operator() ( const T x) const
inline

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

References testing::Matches().

1807  {
1808  // We let matcher_ commit to a particular type here instead of
1809  // when the MatcherAsPredicate object was constructed. This
1810  // allows us to write Matches(m) where m is a polymorphic matcher
1811  // (e.g. Eq(5)).
1812  //
1813  // If we write Matcher<T>(matcher_).Matches(x) here, it won't
1814  // compile when matcher_ has type Matcher<const T&>; if we write
1815  // Matcher<const T&>(matcher_).Matches(x) here, it won't compile
1816  // when matcher_ has type Matcher<T>; if we just write
1817  // matcher_.Matches(x), it won't compile when matcher_ is
1818  // polymorphic, e.g. Eq(5).
1819  //
1820  // MatcherCast<const T&>() is necessary for making the code work
1821  // in all of the above situations.
1822  return MatcherCast<const T&>(matcher_).Matches(x);
1823  }
Definition: InvokeTest.cpp:58
internal::MatcherAsPredicate< M > Matches(M matcher)
template<typename M >
template<typename T >
bool testing::internal::MatcherAsPredicate< M >::operator() ( const T x) const
inline

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

References GTEST_DISALLOW_ASSIGN_, M, and testing::Matches().

1807  {
1808  // We let matcher_ commit to a particular type here instead of
1809  // when the MatcherAsPredicate object was constructed. This
1810  // allows us to write Matches(m) where m is a polymorphic matcher
1811  // (e.g. Eq(5)).
1812  //
1813  // If we write Matcher<T>(matcher_).Matches(x) here, it won't
1814  // compile when matcher_ has type Matcher<const T&>; if we write
1815  // Matcher<const T&>(matcher_).Matches(x) here, it won't compile
1816  // when matcher_ has type Matcher<T>; if we just write
1817  // matcher_.Matches(x), it won't compile when matcher_ is
1818  // polymorphic, e.g. Eq(5).
1819  //
1820  // MatcherCast<const T&>() is necessary for making the code work
1821  // in all of the above situations.
1822  return MatcherCast<const T&>(matcher_).Matches(x);
1823  }
Definition: InvokeTest.cpp:58
internal::MatcherAsPredicate< M > Matches(M matcher)
template<typename M >
template<typename T >
bool testing::internal::MatcherAsPredicate< M >::operator() ( const T x) const
inline

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

References GTEST_DISALLOW_ASSIGN_, M, and testing::Matches().

1807  {
1808  // We let matcher_ commit to a particular type here instead of
1809  // when the MatcherAsPredicate object was constructed. This
1810  // allows us to write Matches(m) where m is a polymorphic matcher
1811  // (e.g. Eq(5)).
1812  //
1813  // If we write Matcher<T>(matcher_).Matches(x) here, it won't
1814  // compile when matcher_ has type Matcher<const T&>; if we write
1815  // Matcher<const T&>(matcher_).Matches(x) here, it won't compile
1816  // when matcher_ has type Matcher<T>; if we just write
1817  // matcher_.Matches(x), it won't compile when matcher_ is
1818  // polymorphic, e.g. Eq(5).
1819  //
1820  // MatcherCast<const T&>() is necessary for making the code work
1821  // in all of the above situations.
1822  return MatcherCast<const T&>(matcher_).Matches(x);
1823  }
Definition: InvokeTest.cpp:58
internal::MatcherAsPredicate< M > Matches(M matcher)

Member Data Documentation

template<typename M >
M testing::internal::MatcherAsPredicate< M >::matcher_
private

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


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