Skip to content

Commit d0c96ea

Browse files
author
Michael McLeod
committed
Update advice on deallocation in constructor
1 parent 09c296e commit d0c96ea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

05libraries/sec01DesigningClasses.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ The concept of RAII is of great importance in a language like C++ which allows y
128128
- Memory allocated by your class should be allocated in the constructor.
129129
- Memory allocated by your class should be de-allocated in the destructor.
130130

131-
If the constructor fails to allocate the resources required for the class, then it should throw an exception. Any resources already allocated by the class before reaching the exception should be deallocated by the destructor.
131+
If the constructor fails to allocate the resources required for the class, then it should throw an exception. Any resources already allocated by the class before reaching the exception should be deallocated.
132132

133133
The goal is to guarantee the following:
134134

0 commit comments

Comments
 (0)