Item-20 Perfer pass-by-reference-to-const to pass-by-value
· ☕ 5 min read
Pass by reference-to-const
is typically more efficient than pass by value and avoids the slicing problem.
Pass by reference-to-const
is typically more efficient than pass by value and avoids the slicing problem.
If you use [] in a new
expression, use [] in the corresponding delete
expression; If not, no [] in the matching delete
expression.