File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -12171,7 +12171,7 @@ Not all member functions can be called.
12171
12171
##### Example
12172
12172
12173
12173
class vector { // very simplified vector of doubles
12174
- // if elem!= nullptr then elem points to sz doubles
12174
+ // if elem != nullptr then elem points to sz doubles
12175
12175
public:
12176
12176
vector() : elem{nullptr}, sz{0}{}
12177
12177
vctor(int s) : elem{new double},sz{s} { /* initialize elements */ }
@@ -12182,7 +12182,7 @@ Not all member functions can be called.
12182
12182
private:
12183
12183
owner<double*> elem;
12184
12184
int sz;
12185
- }
12185
+ };
12186
12186
12187
12187
The class invariant - here stated as a comment - is established by the constructors.
12188
12188
`new` throws if it cannot allocate the required memory.
@@ -12360,7 +12360,7 @@ That would be a leak.
12360
12360
void leak(int x) // don't: may leak
12361
12361
{
12362
12362
auto p = new int{7};
12363
- if (x < 0) throw Get_me_out_of_here{} // may leak *p
12363
+ if (x < 0) throw Get_me_out_of_here{}; // may leak *p
12364
12364
// ...
12365
12365
delete p; // we may never get here
12366
12366
}
You can’t perform that action at this time.
0 commit comments