Electroneum
testing::internal::MatcherCastImpl< T, M > Class Template Reference

#include <gmock-matchers.h>

Static Public Member Functions

static Matcher< TCast (const M &polymorphic_matcher_or_value)
 

Detailed Description

template<typename T, typename M>
class testing::internal::MatcherCastImpl< T, M >

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

Member Function Documentation

◆ Cast()

template<typename T , typename M >
static Matcher<T> testing::internal::MatcherCastImpl< T, M >::Cast ( const M &  polymorphic_matcher_or_value)
inlinestatic

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

517  {
518  // M can be a polymorhic matcher, in which case we want to use
519  // its conversion operator to create Matcher<T>. Or it can be a value
520  // that should be passed to the Matcher<T>'s constructor.
521  //
522  // We can't call Matcher<T>(polymorphic_matcher_or_value) when M is a
523  // polymorphic matcher because it'll be ambiguous if T has an implicit
524  // constructor from M (this usually happens when T has an implicit
525  // constructor from any type).
526  //
527  // It won't work to unconditionally implict_cast
528  // polymorphic_matcher_or_value to Matcher<T> because it won't trigger
529  // a user-defined conversion from M to T if one exists (assuming M is
530  // a value).
531  return CastImpl(
532  polymorphic_matcher_or_value,
533  BooleanConstant<
534  internal::ImplicitlyConvertible<M, Matcher<T> >::value>());
535  }
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
Here is the caller graph for this function:

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