From 63e2cd0ecdaf5b73b623ea00f69203888044d9a3 Mon Sep 17 00:00:00 2001 From: hsutter Date: Thu, 30 Jul 2020 11:22:00 -0700 Subject: [PATCH] Closes #1585 --- CppCoreGuidelines.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index dd07d15..0d8782b 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -11842,6 +11842,8 @@ Instead, prefer to put the common code in a common helper function -- and make i { /* the complex logic around getting a possibly-const reference to my_bar */ } }; +Note: Don't do large non-dependent work inside a template, which leads to code bloat. For example, a further improvement would be if all or part of `get_bar_impl` can be non-dependent and factored out into a common non-template function, for a potentially big reduction in code size. + ##### Exception You may need to cast away `const` when calling `const`-incorrect functions.