Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
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 646 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 648 of file gmock-matchers.h.

648 {
649 // M can be a polymorphic matcher, in which case we want to use
650 // its conversion operator to create Matcher<T>. Or it can be a value
651 // that should be passed to the Matcher<T>'s constructor.
652 //
653 // We can't call Matcher<T>(polymorphic_matcher_or_value) when M is a
654 // polymorphic matcher because it'll be ambiguous if T has an implicit
655 // constructor from M (this usually happens when T has an implicit
656 // constructor from any type).
657 //
658 // It won't work to unconditionally implict_cast
659 // polymorphic_matcher_or_value to Matcher<T> because it won't trigger
660 // a user-defined conversion from M to T if one exists (assuming M is
661 // a value).
662 return CastImpl(
663 polymorphic_matcher_or_value,
664 BooleanConstant<
665 internal::ImplicitlyConvertible<M, Matcher<T> >::value>(),
666 BooleanConstant<
668 }
#define value
Definition pkcs11.h:157
Here is the caller graph for this function:

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