You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CppCoreGuidelines.md
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5696,6 +5696,7 @@ Interfaces should normally be composed entirely of public pure virtual functions
5696
5696
The `Derived` is `delete`d through its `Goof` interface, so its `string` is leaked.
5697
5697
Give `Goof` a virtual destructor and all is well.
5698
5698
5699
+
5699
5700
##### Enforcement
5700
5701
5701
5702
* Warn on any class that contains data members and also has an overridable (non-`final`) virtual function.
@@ -6113,6 +6114,7 @@ However, misuses are (or at least has been) far more common.
6113
6114
6114
6115
Flag uses of `final`.
6115
6116
6117
+
6116
6118
## <a name="Rh-virtual-default-arg"></a>C.140: Do not provide different default arguments for a virtual function and an overrider
6117
6119
6118
6120
##### Reason
@@ -9630,6 +9632,7 @@ In general, don't complicate your code without reason (??)
9630
9632
Never write `return move(local_variable);`, because the language already knows the variable is a move candidate.
9631
9633
Writing `move` in this code won't help, and can actually be detrimental because on some compilers it interferes with RVO (the return value optimization) by creating an additional reference alias to the local variable.
9632
9634
9635
+
9633
9636
##### Example, bad
9634
9637
9635
9638
vector<int> v = std::move(make_vector()); // bad; the std::move is entirely redundant
0 commit comments