From 5bbf8439421bbd6422f3544811388d8f8f10e925 Mon Sep 17 00:00:00 2001 From: ash Date: Thu, 29 Jul 2021 23:52:06 +0500 Subject: [PATCH] T.61 example fixes (#1813) --- CppCoreGuidelines.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index cbd5c2e..885e0a0 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -18034,14 +18034,14 @@ This limits use and typically increases code size. ##### Example, bad - template + template> // requires Regular && Allocator class List { public: struct Link { // does not depend on A T elem; - T* pre; - T* suc; + Link* pre; + Link* suc; }; using iterator = Link*; @@ -18062,11 +18062,11 @@ Typically, the solution is to make what would have been a nested class non-local template struct Link { T elem; - T* pre; - T* suc; + Link* pre; + Link* suc; }; - template + template> // requires Regular && Allocator class List2 { public: @@ -18076,11 +18076,11 @@ Typically, the solution is to make what would have been a nested class non-local // ... private: - Link* head; + Link* head; }; - List lst1; - List lst2; + List2 lst1; + List2 lst2; Some people found the idea that the `Link` no longer was hidden inside the list scary, so we named the technique [SCARY](http://www.open-std.org/jtc1/sc22/WG21/docs/papers/2009/n2911.pdf). From that academic paper: