effective c++
Item-17 Store newed objects in smart pointers in standalone statements
· β 2 min read
Item-16 Use the same form in corresponding uses of new and delete
· β 2 min read
If you use [] in a new
expression, use [] in the corresponding delete
expression; If not, no [] in the matching delete
expression.
Item-15 Provide access to raw resource in resource-managing classes
· β 3 min read
Item-14 Copy behavior in resource-managing classes
· β 4 min read
Copying an RAII object entails copying the resource it manages, so the copying behavior of the resource determines the copying behavior of the RAII object.