From 7261f5d2fb31a8bfdf31f4f7d5260bf6ad7f299a Mon Sep 17 00:00:00 2001 From: mbuchner Date: Tue, 8 May 2018 09:25:01 +0200 Subject: [PATCH] Pass parameter as reference in CP.31 example Fixes #1207. --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 2f2f9eb..3da6c2d 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -14130,12 +14130,12 @@ Defining "small amount" precisely is impossible. ##### Example string modify1(string); - void modify2(shared_ptr); + void modify2(string&); void fct(string& s) { auto res = async(modify1, s); - async(modify2, &s); + async(modify2, s); } The call of `modify1` involves copying two `string` values; the call of `modify2` does not.