From ad93f8d0a697ae0cf11b4e71abc854d1bba8b5fc Mon Sep 17 00:00:00 2001 From: Sergey Zubkov Date: Tue, 8 Jul 2025 23:38:52 -0400 Subject: [PATCH] [T.84] make List::front example compile closes #2231 --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 993bb26..649e10c 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -1,6 +1,6 @@ # C++ Core Guidelines -May 8, 2025 +Jul 8, 2025 Editors: @@ -18753,7 +18753,7 @@ It could be a base class: class List : List_base { public: void put_front(const T& e) { add_front(new Link{e}); } // implicit cast to Link_base - T& front() { static_cast*>(first).val; } // explicit cast back to Link + T& front() { return static_cast*>(first)->val; } // explicit cast back to Link // ... };