From c4fcc6250b164b185ed66406b4a85506391ad78c Mon Sep 17 00:00:00 2001 From: Mos Date: Thu, 16 Mar 2017 19:33:54 +0400 Subject: [PATCH] Fix example for decltype(auto) and Initializer lists --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bb41eea..72a3337 100644 --- a/README.md +++ b/README.md @@ -476,7 +476,7 @@ auto x1 = x; // int decltype(auto) x2 = x; // const int int y = 0; int& y1 = y; -auto y2 = y; // int +auto y2 = y1; // int decltype(auto) y3 = y1; // int& int&& z = 0; auto z1 = std::move(z); // int @@ -594,9 +594,9 @@ int sum(const std::initializer_list& list) { } auto list = { 1, 2, 3 }; -f(list); // == 6 -f({ 1, 2, 3 }); // == 6 -f({}); // == 0 +sum(list); // == 6 +sum({ 1, 2, 3 }); // == 6 +sum({}); // == 0 ``` ### Static assertions