mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
fix c.127 example issue. (#789)
auto will deduce as unique_ptr<D> and the correct destructor will call. Anyway, this should be a bad example.
This commit is contained in:
parent
4d86abfdb4
commit
8a9bb3bc61
@ -6084,7 +6084,7 @@ A class with a virtual function is usually (and in general) used via a pointer t
|
||||
|
||||
void use()
|
||||
{
|
||||
auto p = make_unique<D>();
|
||||
unique_ptr<B> p = make_unique<D>();
|
||||
// ...
|
||||
} // undefined behavior. May call B::~B only and leak the string
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user