From 088e6ed9a8ead32aeb0c340931465e0036b2eb9f Mon Sep 17 00:00:00 2001 From: theidexisted Date: Thu, 19 Aug 2021 16:35:14 +0800 Subject: Simplify example code with c++11 --- docs/gmock_cook_book.md | 5 +---- 1 file changed, 1 insertion(+), 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 names; - names.push_back("George"); - names.push_back("John"); - names.push_back("Thomas"); + vector names = {"George", "John", "Thomas"}; EXPECT_CALL(rolodex, GetNames(_)) .WillOnce(SetArrayArgument<0>(names.begin(), names.end())); ``` -- cgit v1.2.1