Electroneum
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)
 

Detailed Description

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

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

Member Function Documentation

◆ Cast() [1/2]

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.

627  {
628  return internal::MatcherCastImpl<T, M>::Cast(polymorphic_matcher_or_value);
629  }
static Matcher< T > Cast(const M &polymorphic_matcher_or_value)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cast() [2/2]

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.

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 ||
659  conversion_of_arithmetic_types_must_be_lossless);
660  return MatcherCast<T>(matcher);
661  }
#define GMOCK_KIND_OF_(type)
const uint32_t T[512]
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
#define GTEST_COMPILE_ASSERT_(expr, msg)
Definition: gtest-port.h:1032
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T)

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