diff --git a/docs/gmock_cook_book.md b/docs/gmock_cook_book.md index 208ca9a6..26a140eb 100644 --- a/docs/gmock_cook_book.md +++ b/docs/gmock_cook_book.md @@ -3618,6 +3618,9 @@ Expected: is divisible by 7 Actual: 23 (the remainder is 2) ``` +Tip: for convenience, `MatchAndExplain()` can take a `MatchResultListener*` +instead of `std::ostream*`. + ### Writing New Polymorphic Matchers Expanding what we learned above to *polymorphic* matchers is now just as simple diff --git a/googletest/include/gtest/gtest-matchers.h b/googletest/include/gtest/gtest-matchers.h index fd8d9c66..d9ccbbf1 100644 --- a/googletest/include/gtest/gtest-matchers.h +++ b/googletest/include/gtest/gtest-matchers.h @@ -67,6 +67,7 @@ namespace testing { // 1. a class FooMatcherMatcher that implements the matcher interface: // using is_gtest_matcher = void; // bool MatchAndExplain(const T&, std::ostream*); +// (MatchResultListener* can also be used instead of std::ostream*) // void DescribeTo(std::ostream*); // void DescribeNegationTo(std::ostream*); //