mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Update CppCoreGuidelines.md
Fixed typos.
This commit is contained in:
parent
245f82acd5
commit
5a4e719f86
@ -4781,13 +4781,13 @@ not using this (over)general interface in favor of a particular interface found
|
||||
// ... no destructor ...
|
||||
};
|
||||
|
||||
stuct D : B { // bad: class with a resource derived from a class without a virtual destructor
|
||||
struct D : B { // bad: class with a resource derived from a class without a virtual destructor
|
||||
string s {"default"};
|
||||
};
|
||||
|
||||
void use()
|
||||
{
|
||||
B* p = new B;
|
||||
B* p = new D;
|
||||
delete p; // leak the string
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user