mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Closes #1585
This commit is contained in:
parent
01fa6a9bcf
commit
63e2cd0ecd
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user