Googletest export

Replace ByRef with std::ref everywhere in docs.

PiperOrigin-RevId: 320002303
This commit is contained in:
ofats
2020-07-09 13:35:18 -04:00
committed by Gennadiy Rozental
parent 9aaaaf3f3d
commit 08b787796c
2 changed files with 18 additions and 21 deletions
+6 -6
View File
@@ -279,9 +279,10 @@ Matcher | Description
Except `Ref()`, these matchers make a *copy* of `value` in case it's modified or
destructed later. If the compiler complains that `value` doesn't have a public
copy constructor, try wrap it in `ByRef()`, e.g.
`Eq(ByRef(non_copyable_value))`. If you do that, make sure `non_copyable_value`
is not changed afterwards, or the meaning of your matcher will be changed.
copy constructor, try wrap it in `std::ref()`, e.g.
`Eq(std::ref(non_copyable_value))`. If you do that, make sure
`non_copyable_value` is not changed afterwards, or the meaning of your matcher
will be changed.
`IsTrue` and `IsFalse` are useful when you need to use a matcher, or for types
that can be explicitly converted to Boolean, but are not implicitly converted to
@@ -586,13 +587,12 @@ callback type instead of a derived one, e.g.
```
In `InvokeArgument<N>(...)`, if an argument needs to be passed by reference,
wrap it inside `ByRef()`. For example,
wrap it inside `std::ref()`. For example,
```cpp
using ::testing::ByRef;
using ::testing::InvokeArgument;
...
InvokeArgument<2>(5, string("Hi"), ByRef(foo))
InvokeArgument<2>(5, string("Hi"), std::ref(foo))
```
calls the mock function's #2 argument, passing to it `5` and `string("Hi")` by