the public version already has the const qualifier

PiperOrigin-RevId: 706721910
Change-Id: I8a76a66d62028176a70678954f095ac70996cc9e
This commit is contained in:
Abseil Team 2024-12-16 08:39:37 -08:00 committed by Copybara-Service
parent 79219e26e0
commit f3c355f9dd

View File

@ -177,7 +177,7 @@ class StackInterface {
template <typename Elem> template <typename Elem>
class MockStack : public StackInterface<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)); MOCK_METHOD(void, Push, (const Elem& x), (override));
}; };
``` ```
@ -3419,14 +3419,14 @@ itself, as gMock already prints it for you.
#### Argument Types #### Argument Types
The type of the value being matched (`arg_type`) is determined by the The type of the value being matched (`arg_type`) is determined by the context in
context in which you use the matcher and is supplied to you by the compiler, so which you use the matcher and is supplied to you by the compiler, so you don't
you don't need to worry about declaring it (nor can you). This allows the need to worry about declaring it (nor can you). This allows the matcher to be
matcher to be polymorphic. For example, `IsDivisibleBy7()` can be used to match polymorphic. For example, `IsDivisibleBy7()` can be used to match any type where
any type where the value of `(arg % 7) == 0` can be implicitly converted to a the value of `(arg % 7) == 0` can be implicitly converted to a `bool`. In the
`bool`. In the `Bar(IsDivisibleBy7())` example above, if method `Bar()` takes an `Bar(IsDivisibleBy7())` example above, if method `Bar()` takes an `int`,
`int`, `arg_type` will be `int`; if it takes an `unsigned long`, `arg_type` will `arg_type` will be `int`; if it takes an `unsigned long`, `arg_type` will be
be `unsigned long`; and so on. `unsigned long`; and so on.
### Writing New Parameterized Matchers Quickly ### Writing New Parameterized Matchers Quickly