diff options
author | Abseil Team <absl-team@google.com> | 2024-12-16 16:39:37 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-12-16 16:40:16 (GMT) |
commit | f3c355f9dd382bc2c323be2713e351a578b68c61 (patch) | |
tree | bfd14acb1b05aa15ffe50bc6753fc69e79e6ce0e | |
parent | 79219e26e0e36b415a5804b6b017ad6c6cd99ad8 (diff) | |
download | googletest-f3c355f9dd382bc2c323be2713e351a578b68c61.zip googletest-f3c355f9dd382bc2c323be2713e351a578b68c61.tar.gz googletest-f3c355f9dd382bc2c323be2713e351a578b68c61.tar.bz2 |
the public version already has the const qualifier
PiperOrigin-RevId: 706721910
Change-Id: I8a76a66d62028176a70678954f095ac70996cc9e
-rw-r--r-- | docs/gmock_cook_book.md | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/docs/gmock_cook_book.md b/docs/gmock_cook_book.md index 4cc9bb4..948abe9 100644 --- a/docs/gmock_cook_book.md +++ b/docs/gmock_cook_book.md @@ -177,7 +177,7 @@ class StackInterface { template <typename Elem> class MockStack : public StackInterface<Elem> { ... - MOCK_METHOD(int, GetSize, (), (override)); + MOCK_METHOD(int, GetSize, (), (const, override)); MOCK_METHOD(void, Push, (const Elem& x), (override)); }; ``` @@ -3419,14 +3419,14 @@ itself, as gMock already prints it for you. #### Argument Types -The type of the value being matched (`arg_type`) is determined by the -context in which you use the matcher and is supplied to you by the compiler, so -you don't need to worry about declaring it (nor can you). This allows the -matcher to be polymorphic. For example, `IsDivisibleBy7()` can be used to match -any type where the value of `(arg % 7) == 0` can be implicitly converted to a -`bool`. In the `Bar(IsDivisibleBy7())` example above, if method `Bar()` takes an -`int`, `arg_type` will be `int`; if it takes an `unsigned long`, `arg_type` will -be `unsigned long`; and so on. +The type of the value being matched (`arg_type`) is determined by the context in +which you use the matcher and is supplied to you by the compiler, so you don't +need to worry about declaring it (nor can you). This allows the matcher to be +polymorphic. For example, `IsDivisibleBy7()` can be used to match any type where +the value of `(arg % 7) == 0` can be implicitly converted to a `bool`. In the +`Bar(IsDivisibleBy7())` example above, if method `Bar()` takes an `int`, +`arg_type` will be `int`; if it takes an `unsigned long`, `arg_type` will be +`unsigned long`; and so on. ### Writing New Parameterized Matchers Quickly |