Simplify example code with c++11

This commit is contained in:
theidexisted 2021-08-19 16:35:14 +08:00 committed by GitHub
parent 0134d73a49
commit 088e6ed9a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()));
```