proxygen
testing::SafeMatcherCastImpl< T > Class Template Reference

#include <gmock-matchers.h>

Static Public Member Functions

template<typename M >
static Matcher< TCast (const M &polymorphic_matcher_or_value)
 
template<typename U >
static Matcher< TCast (const Matcher< U > &matcher)
 
template<typename M >
static Matcher< TCast (const M &polymorphic_matcher_or_value)
 
template<typename U >
static Matcher< TCast (const Matcher< U > &matcher)
 
template<typename M >
static Matcher< TCast (const M &polymorphic_matcher_or_value)
 
template<typename U >
static Matcher< TCast (const Matcher< U > &matcher)
 

Detailed Description

template<typename T>
class testing::SafeMatcherCastImpl< T >

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

Member Function Documentation

template<typename T >
template<typename M >
static Matcher<T> testing::SafeMatcherCastImpl< T >::Cast ( const M polymorphic_matcher_or_value)
inlinestatic

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

References testing::internal::MatcherCastImpl< T, M >::Cast().

Referenced by testing::SafeMatcherCastImpl< T >::Cast(), and testing::SafeMatcherCast().

627  {
628  return internal::MatcherCastImpl<T, M>::Cast(polymorphic_matcher_or_value);
629  }
static Matcher< T > Cast(const M &polymorphic_matcher_or_value)
template<typename T >
template<typename M >
static Matcher<T> testing::SafeMatcherCastImpl< T >::Cast ( const M polymorphic_matcher_or_value)
inlinestatic

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

References testing::internal::MatcherCastImpl< T, M >::Cast().

627  {
628  return internal::MatcherCastImpl<T, M>::Cast(polymorphic_matcher_or_value);
629  }
static Matcher< T > Cast(const M &polymorphic_matcher_or_value)
template<typename T >
template<typename M >
static Matcher<T> testing::SafeMatcherCastImpl< T >::Cast ( const M polymorphic_matcher_or_value)
inlinestatic

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

References testing::internal::MatcherCastImpl< T, M >::Cast().

627  {
628  return internal::MatcherCastImpl<T, M>::Cast(polymorphic_matcher_or_value);
629  }
static Matcher< T > Cast(const M &polymorphic_matcher_or_value)
template<typename T >
template<typename U >
static Matcher<T> testing::SafeMatcherCastImpl< T >::Cast ( const Matcher< U > &  matcher)
inlinestatic

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

References testing::A(), testing::SafeMatcherCastImpl< T >::Cast(), GMOCK_KIND_OF_, GTEST_COMPILE_ASSERT_, GTEST_REMOVE_REFERENCE_AND_CONST_, testing::internal::IsReadableTypeName(), testing::internal::kOther, M, testing::internal::MatcherBase< T >::MatchAndExplain(), testing::internal::MatcherBase< T >::Matches(), testing::internal::MatchPrintAndExplain(), testing::internal::PrintIfNotEmpty(), testing::SafeMatcherCast(), testing::StringMatchResultListener::str(), T, testing::internal::UniversalPrint(), value, and testing::Value().

641  {
642  // Enforce that T can be implicitly converted to U.
644  T_must_be_implicitly_convertible_to_U);
645  // Enforce that we are not converting a non-reference type T to a reference
646  // type U.
649  cannot_convert_non_referentce_arg_to_reference);
650  // In case both T and U are arithmetic types, enforce that the
651  // conversion is not lossy.
652  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(T) RawT;
653  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(U) RawU;
654  const bool kTIsOther = GMOCK_KIND_OF_(RawT) == internal::kOther;
655  const bool kUIsOther = GMOCK_KIND_OF_(RawU) == internal::kOther;
657  kTIsOther || kUIsOther ||
658  (internal::LosslessArithmeticConvertible<RawT, RawU>::value),
659  conversion_of_arithmetic_types_must_be_lossless);
660  return MatcherCast<T>(matcher);
661  }
Matcher< T > MatcherCast(const M &matcher)
#define T(v)
Definition: http_parser.c:233
#define GTEST_COMPILE_ASSERT_(expr, msg)
Definition: gtest-port.h:1032
static const char *const value
Definition: Conv.cpp:50
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T)
const
Definition: upload.py:398
#define GMOCK_KIND_OF_(type)
template<typename T >
template<typename U >
static Matcher<T> testing::SafeMatcherCastImpl< T >::Cast ( const Matcher< U > &  matcher)
inlinestatic

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

References GMOCK_KIND_OF_, GTEST_COMPILE_ASSERT_, GTEST_REMOVE_REFERENCE_AND_CONST_, testing::internal::kOther, T, and value.

641  {
642  // Enforce that T can be implicitly converted to U.
644  T_must_be_implicitly_convertible_to_U);
645  // Enforce that we are not converting a non-reference type T to a reference
646  // type U.
649  cannot_convert_non_referentce_arg_to_reference);
650  // In case both T and U are arithmetic types, enforce that the
651  // conversion is not lossy.
652  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(T) RawT;
653  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(U) RawU;
654  const bool kTIsOther = GMOCK_KIND_OF_(RawT) == internal::kOther;
655  const bool kUIsOther = GMOCK_KIND_OF_(RawU) == internal::kOther;
657  kTIsOther || kUIsOther ||
658  (internal::LosslessArithmeticConvertible<RawT, RawU>::value),
659  conversion_of_arithmetic_types_must_be_lossless);
660  return MatcherCast<T>(matcher);
661  }
Matcher< T > MatcherCast(const M &matcher)
#define T(v)
Definition: http_parser.c:233
#define GTEST_COMPILE_ASSERT_(expr, msg)
Definition: gtest-port.h:1032
static const char *const value
Definition: Conv.cpp:50
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T)
const
Definition: upload.py:398
#define GMOCK_KIND_OF_(type)
template<typename T >
template<typename U >
static Matcher<T> testing::SafeMatcherCastImpl< T >::Cast ( const Matcher< U > &  matcher)
inlinestatic

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

References testing::A(), testing::SafeMatcherCastImpl< T >::Cast(), GMOCK_KIND_OF_, GTEST_COMPILE_ASSERT_, GTEST_REMOVE_REFERENCE_AND_CONST_, testing::internal::IsReadableTypeName(), testing::internal::kOther, M, testing::internal::MatcherBase< T >::MatchAndExplain(), testing::internal::MatcherBase< T >::Matches(), testing::internal::MatchPrintAndExplain(), testing::internal::PrintIfNotEmpty(), testing::SafeMatcherCast(), testing::StringMatchResultListener::str(), T, testing::internal::UniversalPrint(), value, and testing::Value().

641  {
642  // Enforce that T can be implicitly converted to U.
644  T_must_be_implicitly_convertible_to_U);
645  // Enforce that we are not converting a non-reference type T to a reference
646  // type U.
649  cannot_convert_non_referentce_arg_to_reference);
650  // In case both T and U are arithmetic types, enforce that the
651  // conversion is not lossy.
652  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(T) RawT;
653  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(U) RawU;
654  const bool kTIsOther = GMOCK_KIND_OF_(RawT) == internal::kOther;
655  const bool kUIsOther = GMOCK_KIND_OF_(RawU) == internal::kOther;
657  kTIsOther || kUIsOther ||
658  (internal::LosslessArithmeticConvertible<RawT, RawU>::value),
659  conversion_of_arithmetic_types_must_be_lossless);
660  return MatcherCast<T>(matcher);
661  }
Matcher< T > MatcherCast(const M &matcher)
#define T(v)
Definition: http_parser.c:233
#define GTEST_COMPILE_ASSERT_(expr, msg)
Definition: gtest-port.h:1032
static const char *const value
Definition: Conv.cpp:50
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T)
const
Definition: upload.py:398
#define GMOCK_KIND_OF_(type)

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