Skip to content

Commit dc68352

Browse files
committed
wrong sample class
1 parent 01b66d9 commit dc68352

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CppCoreGuidelines.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4169,7 +4169,7 @@ Note that if you define a destructor, you must define or delete [all default ope
41694169
~Smart_ptr2() { delete p; } // p is an owner!
41704170
};
41714171

4172-
void use(Smart_ptr<int> p1)
4172+
void use(Smart_ptr2<int> p1)
41734173
{
41744174
auto p2 = p1; // error: double deletion
41754175
}
@@ -4440,8 +4440,8 @@ The C++11 initializer list rule eliminates the need for many constructors. For e
44404440
Rec2(const string& ss, int ii = 0) :s{ss}, i{ii} {} // redundant
44414441
};
44424442

4443-
Rec r1 {"Foo", 7};
4444-
Rec r2 {"Bar"};
4443+
Rec2 r1 {"Foo", 7};
4444+
Rec2 r2 {"Bar"};
44454445

44464446
The `Rec2` constructor is redundant.
44474447
Also, the default for `int` would be better done as a [member initializer](#Rc-in-class-initializer).

0 commit comments

Comments
 (0)