From 6ad29ce6095b343c41d61fef4ed8fcef34cae334 Mon Sep 17 00:00:00 2001 From: hsutter Date: Thu, 1 Oct 2020 11:30:30 -0700 Subject: [PATCH] Fixes ES.50 example and closes #1682 Also removes the only use of `decltype` in the Guidelines, FTW. --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 90bbd88..55da11e 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -11806,7 +11806,7 @@ Instead, prefer to put the common code in a common helper function -- and make i Bar my_bar; template // good, deduces whether T is const or non-const - static auto get_bar_impl(T& t) -> decltype(t.get_bar()) + static auto& get_bar_impl(T& t) { /* the complex logic around getting a possibly-const reference to my_bar */ } }; -- 2.11.4.GIT