Googletest export
Change Matcher<T> to allow binding an implementation by value directly: - Drop the requirement of MatcherInterface. Doing manual type erasure avoid extra layers in many cases. - Avoid the adaptor for `MatcherInterface<T>` and `MatcherInterface<const T&>` mismatch. - Use a small object optimization when possible. This makes things like `_` and `Eq(1)` really cheap and do not require memory allocations. - Migrate some matchers to the new model to speed them up and to test the new framework. More matchers to come in future changes. PiperOrigin-RevId: 350580998
This commit is contained in:
@@ -410,7 +410,7 @@ TEST(StringMatcherTest,
|
||||
// MatcherInterface* without requiring the user to explicitly
|
||||
// write the type.
|
||||
TEST(MakeMatcherTest, ConstructsMatcherFromMatcherInterface) {
|
||||
const MatcherInterface<int>* dummy_impl = nullptr;
|
||||
const MatcherInterface<int>* dummy_impl = new EvenMatcherImpl;
|
||||
Matcher<int> m = MakeMatcher(dummy_impl);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user