Electroneum
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 515 of file gmock-matchers.h.

Member Function Documentation

◆ Cast()

template<typename T, typename M>
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(
535 }
Here is the caller graph for this function:

The documentation for this class was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h