Lines Matching refs:To

61 // To implement a matcher Foo for type T, define:
421 // To define a polymorphic matcher, a user should provide an Impl
2103 // The result of dynamic_cast<To> is forwarded to the inner matcher.
2104 // If To is a pointer and the cast fails, the inner matcher will receive NULL.
2105 // If To is a reference and the cast fails, this matcher returns false
2107 template <typename To>
2110 explicit WhenDynamicCastToMatcherBase(const Matcher<To>& matcher)
2124 const Matcher<To> matcher_;
2128 return GetTypeName<To>();
2143 // To is a pointer. Cast and forward the result.
2144 template <typename To>
2145 class WhenDynamicCastToMatcher : public WhenDynamicCastToMatcherBase<To> {
2147 explicit WhenDynamicCastToMatcher(const Matcher<To>& matcher)
2148 : WhenDynamicCastToMatcherBase<To>(matcher) {}
2153 To to = dynamic_cast<To>(from);
2160 template <typename To>
2161 class WhenDynamicCastToMatcher<To&> : public WhenDynamicCastToMatcherBase<To&> {
2163 explicit WhenDynamicCastToMatcher(const Matcher<To&>& matcher)
2164 : WhenDynamicCastToMatcherBase<To&>(matcher) {}
2169 To* to = dynamic_cast<To*>(&from);
2278 posix::Abort(); // To make sure it is never run.
3163 // To work with stream-like "containers", we must only walk
3878 // inner_matcher when dynamic_cast<To> is applied.
3879 // The result of dynamic_cast<To> is forwarded to the inner matcher.
3880 // If To is a pointer and the cast fails, the inner matcher will receive NULL.
3881 // If To is a reference and the cast fails, this matcher returns false
3883 template <typename To>
3884 inline PolymorphicMatcher<internal::WhenDynamicCastToMatcher<To> >
3885 WhenDynamicCastTo(const Matcher<To>& inner_matcher) {
3887 internal::WhenDynamicCastToMatcher<To>(inner_matcher));