From bba456f12f1be5e5b183749e4b3b96fdc99b21ef Mon Sep 17 00:00:00 2001 From: Yunbin Liu Date: Wed, 11 Dec 2019 04:48:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=20C++11=20=E7=89=88=E6=9C=AC=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=20decltype(auto)=20=E6=94=B9=E4=B8=BA=20auto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.DeducingTypes/item3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1.DeducingTypes/item3.md b/1.DeducingTypes/item3.md index 212d59b..7e987e2 100644 --- a/1.DeducingTypes/item3.md +++ b/1.DeducingTypes/item3.md @@ -125,7 +125,7 @@ authAndAccess(Container&& c,Index i){ 这样就能对我们的期望交上一份满意的答卷,但是这要求编译器支持C++14。如果你没有这样的编译器,你还需要使用C++11版本的模板,它看起来和C++14版本的极为相似,除了你不得不指定函数返回类型之外: ````cpp template //最终的C++11版本 -decltype(auto) +auto authAndAccess(Container&& c,Index i) ->decltype(std::forward(c)[i]) {