summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortheidexisted <invalid_ms_user@live.com>2021-08-19 16:35:14 +0800
committerGitHub <noreply@github.com>2021-08-19 16:35:14 +0800
commit088e6ed9a8ead32aeb0c340931465e0036b2eb9f (patch)
tree690c946f683da7a4c9434100361cf25a8e983fe8
parent0134d73a4902574269ff2e42827f7573d3df08ae (diff)
downloadgoogletest-git-088e6ed9a8ead32aeb0c340931465e0036b2eb9f.tar.gz
Simplify example code with c++11
-rw-r--r--docs/gmock_cook_book.md5
1 files changed, 1 insertions, 4 deletions
diff --git a/docs/gmock_cook_book.md b/docs/gmock_cook_book.md
index 900bcd1d..baeeb59f 100644
--- a/docs/gmock_cook_book.md
+++ b/docs/gmock_cook_book.md
@@ -2033,10 +2033,7 @@ class MockRolodex : public Rolodex {
}
...
MockRolodex rolodex;
- vector<string> names;
- names.push_back("George");
- names.push_back("John");
- names.push_back("Thomas");
+ vector<string> names = {"George", "John", "Thomas"};
EXPECT_CALL(rolodex, GetNames(_))
.WillOnce(SetArrayArgument<0>(names.begin(), names.end()));
```